diff --git a/.gitignore b/.gitignore index 56ac5b42..d8c17abb 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ yarn-error.log* /project/*/dist /ui/package-lock.json /examples/modules.json +/examples/router/apps.js +/src/apps/ +/src/config.json diff --git a/.npmrc b/.npmrc index b32e9535..d4678dd9 100644 --- a/.npmrc +++ b/.npmrc @@ -1,5 +1,4 @@ -registry=http://192.168.1.87:4873/ email=aixianling@sinoecare.com -always-auth=true package-lock=false -//192.168.1.87:4873/:_auth="YWRtaW46YWRtaW4xMjM=" +registry=http://registry.npmmirror.com +legacy-peer-deps=true diff --git a/bin/scanApps.js b/bin/scanApps.js new file mode 100644 index 00000000..1819330f --- /dev/null +++ b/bin/scanApps.js @@ -0,0 +1,36 @@ +const {chalkTag, findApp, fs, fsExtra} = require("./tools"); +const compiler = require('vue-template-compiler') +const getAppInfo = (file, apps) => { + if (/[\\\/](App[A-Z][^\\\/]+)\.vue$/g.test(file)) { + const name = file.replace(/.+[\\\/](App[^\\\/]+)\.vue$/, '$1'), + source = fs.readFileSync(file).toString(), + parsed = compiler.parseComponent(source), + script = parsed.script?.content || "", + label = script.match(/label:[^,]+/)?.[0]?.replace(/.+["']([^"']+).+/, '$1') + const paths = file.split(/[\\\/]/) + apps.push({ + id: file.replace(/\.vue$/, '').replace(/[\\\/]/g, '_'), + label: label || name, + path: `/${file.replace(/\.vue$/, '').replace(/[\\\/]/g, '/')}`, + workspace: paths.at(0), + esm: file.replace(/[\\\/]/g, '/'), + name + }) + } +} + +const start = () => { + chalkTag.info("开始扫描库工程...") + const list = [] + Promise.all([ + findApp('packages', app => getAppInfo(app, list)), + findApp('project', app => getAppInfo(app, list)), + ]).then(() => { + fsExtra.outputFile('examples/router/apps.js', `export default [${list.map(e => { + const {name, label, path, esm} = e + return `{name:"${name}",label:"${label}",path:"${path}",component:()=>import("@${esm}")}` + }).join(',\n')}]`) + chalkTag.done("扫描完毕") + }) +} +start() diff --git a/examples/components/sliderNav.vue b/examples/components/sliderNav.vue index e40d30b6..a3c350df 100644 --- a/examples/components/sliderNav.vue +++ b/examples/components/sliderNav.vue @@ -39,10 +39,10 @@ export default { } }, computed: { - ...mapState(['user', 'apps']), + ...mapState(['user']), navs() { let reg = new RegExp(`.*${this.searchApp?.replace(/-/g,'')||''}.*`, 'gi') - return (this.apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label)).map(e => { + return (this.$apps || []).filter(e => !this.searchApp || reg?.test(e.name) || reg?.test(e.label)).map(e => { if (/\/project\//.test(e.path)) { e.project = process.env.VUE_APP_SCOPE || e.path.replace(/.*project\/([^\/]+)\/.+/, '$1') } else if (/\/core\//.test(e.path)) { @@ -52,9 +52,9 @@ export default { }) }, menuPath() { - let paths = [], current = this.apps?.find(e => e.name == this.$route.name) + let paths = [], current = this.$apps?.find(e => e.name == this.$route.name) const findParent = name => { - let menu = this.apps?.find(e => e.name == name) + let menu = this.$apps?.find(e => e.name == name) if (menu) { paths.push(menu.name) if (!!menu.parentId) findParent(menu.parentId) diff --git a/examples/main.js b/examples/main.js index f651e24e..e431d335 100644 --- a/examples/main.js +++ b/examples/main.js @@ -1,7 +1,7 @@ import Vue from 'vue'; import App from './App.vue'; import ui from 'element-ui'; -import router from './router/router'; +import router from './router'; import axios from './router/axios'; import utils from './utils'; import dui from 'dui'; @@ -22,6 +22,7 @@ const app = new Vue({ store, render: h => h(App) }); + let theme = null store.dispatch('getSystem').then(res => { theme = JSON.parse(res?.colorScheme || null) diff --git a/examples/router/autoRoutes.js b/examples/router/autoRoutes.js deleted file mode 100644 index 53bdc4ac..00000000 --- a/examples/router/autoRoutes.js +++ /dev/null @@ -1,81 +0,0 @@ -import store from "../store"; -import {waiting} from "../utils"; -import appEntry from "../views/appEntry"; -import router from "./router"; - -export default { - routes: () => store.state.apps, - init() { - //约束正则式 - store.commit("cleanApps") - // 自动化本工程应用 - waiting.init({innerHTML: '应用加载中..'}) - let startTime = new Date().getTime() - /** - * require.context 的路径变量范式只能为静态字符串 - */ - switch (process.env.VUE_APP_SCOPE) { - case 'dv': - this.esm = { - packages: require.context('../../packages/bigscreen', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy') - } - break - case 'fengdu': - this.esm = { - project: require.context('../../project/fengdu', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy') - } - break - case 'ai': - this.esm = { - biaopin: require.context('../../project/biaopin/AppCopilotConfig', true, /\.\/App[A-Z][^\/]+\.vue$/, 'lazy'), - project: require.context('../../project/ai', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy') - } - break - case 'oms': - this.esm = { - project: require.context('../../project/oms', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy') - } - break - default: - this.esm = { - packages: require.context('../../packages/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy'), - project: require.context('../../project/', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, 'lazy') - } - } - console.log('模块引用用了%s秒', (new Date().getTime() - startTime) / 1000) - startTime = new Date().getTime() - this.loadApps().finally(() => { - console.log('模块加载用了%s秒', (new Date().getTime() - startTime) / 1000) - waiting.close() - }) - }, - loadMods() { - // return Promise.all(mods.apps.map(e => { - // Vue.component(e.name, this.esm[e.workspace](e.esm)) - // const addApp = {...e, component: appEntry} - // waiting.setContent(`加载${e.name}...`) - // //命名规范入口文件必须以App开头 - // return store.commit("addApp", addApp) - // })) - }, - loadApps() { - //新App的自动化格式 - const promise = (mods, base) => Promise.all(mods.keys().map(path => mods(path).then(file => { - if (file.default) { - const {name, label} = file.default - const addApp = { - name: [base, path.replace(/\.\/?(vue)?/g, '')?.split("/")].flat().join("_"), - label: label || name, - path: `/${base}${path.replace(/\.(\/.+\/App.+)\.vue$/, '$1')}`, - component: appEntry, - esm: file.default - } - waiting.setContent(`加载${name}...`) - router.addRoute(addApp) - //命名规范入口文件必须以App开头 - return store.commit("addApp", addApp) - } else return 0 - }).catch(err => console.log(err)))) - return Promise.all(Object.entries(this.esm).map(([root, mods]) => promise(mods, root))).catch(console.error) - } -} diff --git a/examples/router/router.js b/examples/router/index.js similarity index 74% rename from examples/router/router.js rename to examples/router/index.js index 2d0cd32f..7da1b9ef 100644 --- a/examples/router/router.js +++ b/examples/router/index.js @@ -1,13 +1,13 @@ import Vue from 'vue' import VueRouter from 'vue-router' -import autoRoutes from './autoRoutes' +import apps from "./apps"; Vue.use(VueRouter) -autoRoutes.init() +Vue.prototype.$apps = apps export default new VueRouter({ mode: 'history', hashbang: false, - routes: autoRoutes.routes(), + routes: apps, scrollBehavior(to) { if (to.hash) { return { diff --git a/examples/store/index.js b/examples/store/index.js index 4a00b8e4..f7b2175e 100644 --- a/examples/store/index.js +++ b/examples/store/index.js @@ -5,22 +5,8 @@ import * as modules from "dui/lib/js/modules" import xsActions from "../../project/xiushan/actions" Vue.use(Vuex) - export default new Vuex.Store({ - state: { - apps: [] - }, - mutations: { - addApp(state, app) { - state.apps.push(app) - }, - cleanApps(state) { - state.apps = [] - }, - }, - actions: { - ...xsActions - }, + actions: {...xsActions}, modules, plugins: [preState()] }) diff --git a/package.json b/package.json index d6869fc9..6159b716 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "preui": "npm publish -ws||(npm unpublish -f -ws&&npm publish -ws)", "ui": "npm i dui@latest @dui/dv@latest", "sync": "node bin/appsSync.js", - "preview": "vue-cli-service serve" + "preview": "vue-cli-service serve", + "predev": "node bin/scanApps.js" }, "workspaces": [ "ui", @@ -33,6 +34,7 @@ "bin-ace-editor": "^3.2.0", "dayjs": "^1.8.35", "dui": "^2.0.0", + "echarts": "^5.5.1", "echarts-wordcloud": "^2.0.0", "hash.js": "^1.1.7", "html2canvas": "^1.4.1", diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 00000000..482a001d --- /dev/null +++ b/src/App.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/assets/bg_prolife.png b/src/assets/bg_prolife.png new file mode 100644 index 00000000..98f605c1 Binary files /dev/null and b/src/assets/bg_prolife.png differ diff --git a/src/assets/building.png b/src/assets/building.png new file mode 100644 index 00000000..1200fbdf Binary files /dev/null and b/src/assets/building.png differ diff --git a/src/assets/loginLeft.png b/src/assets/loginLeft.png new file mode 100644 index 00000000..8a52732c Binary files /dev/null and b/src/assets/loginLeft.png differ diff --git a/src/assets/loginRightBottom.png b/src/assets/loginRightBottom.png new file mode 100644 index 00000000..aa9fd5f1 Binary files /dev/null and b/src/assets/loginRightBottom.png differ diff --git a/src/assets/loginRightTop.png b/src/assets/loginRightTop.png new file mode 100644 index 00000000..80694dc0 Binary files /dev/null and b/src/assets/loginRightTop.png differ diff --git a/src/assets/nav_bg.png b/src/assets/nav_bg.png new file mode 100644 index 00000000..ae546ee3 Binary files /dev/null and b/src/assets/nav_bg.png differ diff --git a/src/components/AiAreaPicker.vue b/src/components/AiAreaPicker.vue new file mode 100644 index 00000000..8315a8ff --- /dev/null +++ b/src/components/AiAreaPicker.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/src/components/AppLicence.vue b/src/components/AppLicence.vue new file mode 100644 index 00000000..6af1b58f --- /dev/null +++ b/src/components/AppLicence.vue @@ -0,0 +1,181 @@ + + + diff --git a/src/components/headerNav.vue b/src/components/headerNav.vue new file mode 100644 index 00000000..0918c4bc --- /dev/null +++ b/src/components/headerNav.vue @@ -0,0 +1,255 @@ + + + + + + diff --git a/src/components/headerTools/appQrcode.vue b/src/components/headerTools/appQrcode.vue new file mode 100644 index 00000000..262640af --- /dev/null +++ b/src/components/headerTools/appQrcode.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/src/components/headerTools/downloanCenterBtn.vue b/src/components/headerTools/downloanCenterBtn.vue new file mode 100644 index 00000000..5406a0d1 --- /dev/null +++ b/src/components/headerTools/downloanCenterBtn.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/src/components/headerTools/dvBtn.vue b/src/components/headerTools/dvBtn.vue new file mode 100644 index 00000000..bcbfdeaf --- /dev/null +++ b/src/components/headerTools/dvBtn.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/components/headerTools/linkBtn.vue b/src/components/headerTools/linkBtn.vue new file mode 100644 index 00000000..84a4e7ac --- /dev/null +++ b/src/components/headerTools/linkBtn.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/components/mainContent.vue b/src/components/mainContent.vue new file mode 100644 index 00000000..c35a018b --- /dev/null +++ b/src/components/mainContent.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/sliderNav.vue b/src/components/sliderNav.vue new file mode 100644 index 00000000..d58341cf --- /dev/null +++ b/src/components/sliderNav.vue @@ -0,0 +1,296 @@ + + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 00000000..8ba0b702 --- /dev/null +++ b/src/main.js @@ -0,0 +1,33 @@ +import Vue from 'vue'; +import App from './App.vue'; +import ui from 'element-ui'; +import router from './utils/router'; +import utils from './utils'; +import vcUI from 'dui'; +import appComp from '@dui/dv'; +import store from './utils/store'; +import autoRoutes from "./utils/autoRoutes"; +import extra from "./config.json" +import axios from "./utils/axios"; +//import ob from "dui/lib/js/observer" +//备注底座信息,勿删 +console.log("欢迎使用%s", extra.sysInfo?.name || "构建版本") +//new ob() +window.Vue = Vue +Vue.use(ui); +Vue.use(vcUI); +Vue.use(appComp); +Vue.config.productionTip = false; +Vue.prototype.$cdn = "https://cdn.cunwuyun.cn" +Vue.prototype.$request = axios +Object.keys(utils).map((e) => (Vue.prototype[e] = utils[e])); +const loadPage = () => autoRoutes.init().finally(() => new Vue({router, store, render: h => h(App)}).$mount("#app")) +let theme = null +store.dispatch('getSystem', extra.sysInfo).then(res => { + theme = JSON.parse(res?.colorScheme || null) + return import(`dui/lib/styles/theme.${theme?.web}.scss`).catch(() => 0) +}).finally(() => { + Vue.prototype.$theme = theme?.web || "blue" + !!theme?.web && theme?.web != "blue" ? loadPage() : import(`dui/lib/styles/common.scss`).finally(loadPage) +}) + diff --git a/src/utils/autoRoutes.js b/src/utils/autoRoutes.js new file mode 100644 index 00000000..720db2a1 --- /dev/null +++ b/src/utils/autoRoutes.js @@ -0,0 +1,107 @@ +import {waiting} from "./index"; +import router from "./router"; +import store from "./store"; +import {Message} from "element-ui"; +import Vue from "vue"; +import extra from "../config.json" + +let {state: {user}, commit, dispatch} = store +const signOut = () => commit("signOut"), + getUserInfo = () => dispatch("getUserInfo"), + existRoute = route => { + return router.getRoutes()?.find(e => e.name == route?.name || e.path == route?.path) + }, + goto = (route, next) => { + const exist = !!existRoute(route) + return exist ? route.name ? next() : router.replace(route) : + !route.name && route.path == "/" ? router.replace({name: "Home"}).catch(() => 0) : + Message.error("无法找到路由,请联系系统管理员!") + } +const loadApps = () => { + //新App的自动化格式 + waiting.init({innerHTML: '应用加载中..'}) + let apps = require.context('../../apps', true, /\.(\/.+)\/App[A-Z][^\/]+\.vue$/, "lazy") + return Promise.all(apps.keys().map(path => apps(path).then(file => { + if (file.default) { + let {name} = file.default + waiting.setContent(`加载${name}...`) + Vue.component(name, file.default) + } else return 0 + }))).then(() => { + waiting.setContent(`正在进入系统...`) + setTimeout(() => waiting.close(), 1000) + }) +} +const addHome = homePage => { + const component = extra?.homePage || homePage.path + if (extra?.homePage && Vue.component(component)) { + homePage = {...homePage, path: component, component: () => import('../views/mainEntry'), meta: component} + } + router.addRoute('Home', homePage) + router.options.routes[2].children.unshift(homePage) + commit("setHomePage", { + ...homePage, + label: homePage.name, + id: `/v/${component}`, + isMenu: 1, + route: homePage.name, + component, + path: component, + }) +} +const generateRoutes = (to, from, next) => { + if (router.options.routes[2].children.length > 0) { + goto(to, next) + } else { + Promise.all([getUserInfo(), loadApps()]).then(() => { + //初始化默认工作台 + let homePage = {name: "工作台", path: "console", style: "iconfont iconNav_Dashborad", component: () => import('../views/console')} + addHome(homePage) + const mods = user.info.menuSet?.filter(e => !!e.component)?.map(e => ({route: e.id, ...e})) + mods?.map(({route: name, path, component}) => { + if (!!Vue.component(component) && path && !existRoute({name})) { + let search = path.split("?") + path = search?.[0] || path + const route = {name, path, component: () => import('../views/mainEntry'), meta: component} + router.addRoute('Home', route) + router.options.routes[2].children.push(route) + } + }) + to.name == "Home" ? next({name: homePage.name, replace: true}) : next({...to, replace: true}) + }).then(() => commit("setRoutes", router.options.routes[2].children)) + } +} +export const routes = [ + {path: "/login", name: "登录", component: () => import('../views/sign')}, + {path: '/dv', name: '数据大屏入口', component: () => import('../views/dvIndex')}, + {path: '/v', name: 'Home', component: () => import('../views/home'), children: []}, + {path: '/', name: "init"}, +] +export default { + init: () => { + router.beforeEach((to, from, next) => { + console.log('%s=>%s', from.name, to.name) + if (to.hash == "#pddv") { + const {query} = to + dispatch("getToken", { + username: "18971406276", + password: "admin321!" + }).then(() => next({name: "数据大屏入口", query, hash: "#dv"})) + } else if (["数据大屏入口", "登录"].includes(to.name)) { + next() + } else if (to.hash == "#dv") { + //数据大屏进行的独立页面跳转 + let {query, hash} = to + next({name: "数据大屏入口", query, hash}) + } else if (user.token) { + to.name == "init" ? next({name: "Home"}) : generateRoutes(to, from, next) + } else { + signOut() + } + }) + router.onError(err => { + console.error(err) + }) + return Promise.resolve() + } +} diff --git a/src/utils/axios.js b/src/utils/axios.js new file mode 100644 index 00000000..83466bb4 --- /dev/null +++ b/src/utils/axios.js @@ -0,0 +1,26 @@ +import instance from 'dui/lib/js/request' +import {Message} from 'element-ui' +import extra from "../config.json"; +import store from "./store" + +let baseURLs = { + production: extra.base || "/", + development: extra.baseURL || '/lan', +} +instance.defaults.baseURL = baseURLs[process.env.NODE_ENV] +instance.interceptors.request.use(config => { + config.timeout = 300000 + if (extra?.isSingleService) { + config.url = config.url.replace(/(app|auth|admin)\//, "api/") + } + if (config.url.startsWith("/node")) { + config.baseURL = "/ns" + } + return config +}, error => Message.error(error)) +instance.interceptors.response.use(res => res, err => { + if (err?.code == 401) { + store.commit('signOut', 1) + } +}) +export default instance diff --git a/src/utils/index.js b/src/utils/index.js new file mode 100644 index 00000000..9932a1f0 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,100 @@ +import {MessageBox} from 'element-ui' +import tools from 'dui/lib/js/utils' +import store from "./store"; + +let {state: {user}} = store +const addChildParty = (parent, pending) => { + let doBeforeCount = pending.length + parent["children"] = parent["children"] || [] + pending.map((e, index, arr) => { + if (e.partyOrgParentId == parent.partyOrgId) { + parent.children.push(e) + arr.splice(index, 1) + addChildParty(parent, arr) + } + }) + if (parent.children.length == 0) { + delete parent.children + } + if (pending.length > 0 && doBeforeCount > pending.length) { + parent.children.map(c => addChildParty(c, pending)) + } +} +/** + * 封装提示框 + */ + + +const $confirm = (content, options) => { + return MessageBox.confirm(content, { + type: "warning", + confirmButtonText: "确认", + center: true, + title: "提示", + dangerouslyUseHTMLString: true, + ...options + }) +} + +/** + * 封装权限判断方法 + */ + + +const $permissions = flag => { + const buttons = user?.info?.buttons + if (buttons) return buttons.some(b => b.id == flag || b.permission == flag) + else return false +} + +const $decimalCalc = (...arr) => { + //确认提升精度 + let decimalLengthes = arr.map(e => { + let index = ("" + e).indexOf(".") + return ("" + e).length - index + }) + let maxDecimal = Math.max(...decimalLengthes), precision = Math.pow(10, maxDecimal) + //计算 + let intArr = arr.map(e => (Number(e) || 0) * precision) + //返回计算值 + return intArr.reduce((t, a) => t + a) / precision +} +export const waiting = { + init(ops, count) { + if (document.body) { + let div = document.createElement('div') + div.id = "ai-waiting" + div.innerHTML = "信息正在加载中..." + div.className = "el-loading-mask is-fullscreen" + div.style.zIndex = '202204271710' + div.style.textAlign = 'center' + div.style.lineHeight = '100vh' + div.style.background = 'rgba(255,255,255,.8)' + div.style.backdropFilter = 'blur(6px)' + document.body.appendChild(div) + } else if (count < 10) { + setTimeout(() => this.init(ops, ++count), 500) + } + }, + getDom() { + return document.querySelector('#ai-waiting') + }, + setContent(html) { + let div = this.getDom() + div.innerHTML = html + }, + close() { + let div = this.getDom() + div.parentElement.removeChild(div) + } +} +export default { + ...tools, + addChildParty, + $confirm, + $permissions, + $decimalCalc, + $waiting: waiting +} + + diff --git a/src/utils/router.js b/src/utils/router.js new file mode 100644 index 00000000..ba25ce28 --- /dev/null +++ b/src/utils/router.js @@ -0,0 +1,19 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' +import {routes} from "./autoRoutes" +import config from "../config.json" + +Vue.use(VueRouter) +export default new VueRouter({ + base: config.base || '/', + mode: 'history', + hashbang: false, + routes, + scrollBehavior(to) { + if (to.hash) { + return { + selector: to.hash + } + } + } +}) diff --git a/src/utils/store.js b/src/utils/store.js new file mode 100644 index 00000000..6bc79857 --- /dev/null +++ b/src/utils/store.js @@ -0,0 +1,44 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import preState from 'vuex-persistedstate' +import * as modules from "dui/lib/js/modules" +import axios from "./axios"; +import extra from "../config.json" + +Vue.use(Vuex) + +export default new Vuex.Store({ + state: { + homePage: {} + }, + mutations: { + setHomePage(state, home) { + state.homePage = home + }, + signOut(state, flag) { + const base = extra.base || "" + if (flag) { + state.user.token = null; + state.user.info = {} + sessionStorage.clear(); + location.href = base + '/login' + location.hash; + } else { + axios.delete('/auth/token/logout').then(() => { + state.user.token = null; + sessionStorage.clear(); + state.user.info = {} + location.href = base + '/login'; + }); + } + }, + }, + getters: { + //后台数据库中的应用集合,在本工程中不一定存在 + mods: state => [ + state.homePage, + state.user.info?.menuSet?.map(e => ({route: e.id, ...e, label: e.name})) + ].flat().filter(Boolean) + }, + modules, + plugins: [preState()] +}) diff --git a/src/views/building.vue b/src/views/building.vue new file mode 100644 index 00000000..43995c71 --- /dev/null +++ b/src/views/building.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/views/console.vue b/src/views/console.vue new file mode 100644 index 00000000..d46509df --- /dev/null +++ b/src/views/console.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/views/dvIndex.vue b/src/views/dvIndex.vue new file mode 100644 index 00000000..ba9cc595 --- /dev/null +++ b/src/views/dvIndex.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/views/home.vue b/src/views/home.vue new file mode 100644 index 00000000..6a64b55b --- /dev/null +++ b/src/views/home.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/views/mainEntry.vue b/src/views/mainEntry.vue new file mode 100644 index 00000000..982e7c0b --- /dev/null +++ b/src/views/mainEntry.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/views/sign.vue b/src/views/sign.vue new file mode 100644 index 00000000..3fa91ca1 --- /dev/null +++ b/src/views/sign.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index c6fc5c30..0d755e16 100644 --- a/vue.config.js +++ b/vue.config.js @@ -13,15 +13,19 @@ module.exports = { }, transpileDependencies: [/dui[\\\/]lib[\\\/]js/], chainWebpack: (config) => { + config.resolve.alias + .set('@packages', path.resolve(__dirname, 'packages')) + .set('@project', path.resolve(__dirname, 'project')) config.module .rule('js') .include .add(path.resolve(__dirname, 'packages')) - .add(path.resolve(__dirname, 'components')) .add(path.resolve(__dirname, 'project')) .add(path.resolve(__dirname, 'examples')) - .add(path.resolve(__dirname, 'ui')) - .end().use('babel').loader('babel-loader').tap(options => options); + .add(path.resolve(__dirname, 'ui/packages')) + .add(path.resolve(__dirname, 'ui/dv')) + .add(path.resolve(__dirname, 'ui/lib/js')) + .end().use('babel').loader('babel-loader').tap(options => options) config.plugin("limit").use(require("webpack/lib/optimize/LimitChunkCountPlugin"), [{maxChunks: 20}]).tap(options => options) }, devServer: {