rk-web-core 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.babelrc +16 -0
  2. package/.editorconfig +9 -0
  3. package/.eslintrc.js +69 -0
  4. package/.prettierrc.js +12 -0
  5. package/README.md +18 -0
  6. package/examples/index.html +10 -0
  7. package/index.html +10 -1
  8. package/package.json +69 -62
  9. package/src/App.vue +15 -0
  10. package/src/core/core/basicRouterDict.js +19 -0
  11. package/src/core/core/staticUrl.js +6 -0
  12. package/src/core/directives/action.js +26 -0
  13. package/src/core/index.js +132 -0
  14. package/src/core/layouts/404.jsx +17 -0
  15. package/src/core/layouts/AdminLayout.jsx +75 -0
  16. package/src/core/layouts/AppLayout.jsx +73 -0
  17. package/src/core/layouts/BasicLayout.jsx +70 -0
  18. package/src/core/layouts/BlankLayout.jsx +6 -0
  19. package/src/core/layouts/FullHeaderLayout.jsx +50 -0
  20. package/src/core/layouts/MapNavLayout.jsx +89 -0
  21. package/src/core/layouts/MapWrapper.jsx +34 -0
  22. package/src/core/layouts/NoSidebarWrapper.jsx +6 -0
  23. package/src/core/layouts/NormalIcon.jsx +30 -0
  24. package/src/core/layouts/SidebarWrapper.jsx +70 -0
  25. package/src/core/layouts/WindIcon.jsx +22 -0
  26. package/{creative-icon.ttf → src/core/layouts/font/creative.ttf} +0 -0
  27. package/src/core/layouts/icon/logo.webp +0 -0
  28. package/src/core/layouts/style/HeaderInfoGroup.less +82 -0
  29. package/src/core/layouts/style/appExternal.less +90 -0
  30. package/src/core/layouts/style/appLogo.less +58 -0
  31. package/src/core/layouts/style/base.less +24 -0
  32. package/src/core/layouts/style/default.less +46 -0
  33. package/src/core/layouts/style/header.less +90 -0
  34. package/src/core/layouts/style/headerExtends.less +115 -0
  35. package/src/core/layouts/style/index.js +9 -0
  36. package/src/core/layouts/style/map.less +20 -0
  37. package/src/core/layouts/style/sidebar.less +105 -0
  38. package/src/core/layouts/widget/AppExternal.jsx +119 -0
  39. package/src/core/layouts/widget/AppLogo.jsx +94 -0
  40. package/src/core/layouts/widget/HeaderInfoGroup.jsx +146 -0
  41. package/src/core/layouts/widget/MapAndBasicHeader.jsx +148 -0
  42. package/src/core/layouts/widget/Sidebar.jsx +198 -0
  43. package/src/core/layouts/widget/headerExtend.jsx +106 -0
  44. package/src/core/micro/index.js +59 -0
  45. package/src/core/router/generator-routers.js +170 -0
  46. package/src/core/router/index.js +63 -0
  47. package/src/core/router/noLogin.js +24 -0
  48. package/src/core/router/permission.js +117 -0
  49. package/src/core/service/index.js +49 -0
  50. package/src/core/service/request.js +190 -0
  51. package/src/core/store/index.js +125 -0
  52. package/src/core/utils/crypto.js +33 -0
  53. package/src/core/utils/eventBus.js +2 -0
  54. package/src/core/utils/navTools.js +256 -0
  55. package/src/core/utils/polymerize.js +15 -0
  56. package/src/core/utils/props-utils.js +336 -0
  57. package/src/core/utils/splaytree.js +112 -0
  58. package/src/core/utils/store.js +11 -0
  59. package/src/core/utils/utils.js +72 -0
  60. package/src/core/version.js +1 -0
  61. package/src/main.js +7 -0
  62. package/webpack.config.js +164 -0
  63. package/1.dcc95742af3ac56d4191.js +0 -1
  64. package/rk-web-core.css +0 -638
  65. package/rk-web-core.js +0 -148
package/.babelrc ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "env",
5
+ {
6
+ "modules": false
7
+ }
8
+ ],
9
+ "stage-3"
10
+ ],
11
+ "compact": false,
12
+ "plugins": [
13
+ "dynamic-import-webpack",
14
+ "babel-plugin-transform-runtime"
15
+ ]
16
+ }
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
package/.eslintrc.js ADDED
@@ -0,0 +1,69 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ },
6
+ extends: ['plugin:vue/strongly-recommended', '@vue/prettier'],
7
+ rules: {
8
+ 'no-console': 'off',
9
+ 'no-debugger': 'off',
10
+ 'no-mixed-operators': 0,
11
+ 'no-parsing-error': 'off',
12
+ 'no-control-regex': 0,
13
+ 'no-tabs': 0,
14
+ 'no-underscore-dangle': 0,
15
+ 'no-delete-var': 2,
16
+ 'no-unused-vars': 'off',
17
+ 'no-unused-expressions': 'off',
18
+ 'no-param-reassign': 'off',
19
+ 'no-empty-function': 0,
20
+ 'no-void': 0,
21
+ eqeqeq: 0,
22
+ 'no-plusplus': 0,
23
+ 'no-prototype-builtins': 0,
24
+ 'no-restricted-syntax': 0,
25
+ 'no-extra-boolean-cast': 'off',
26
+ 'generator-star-spacing': 'off',
27
+ indent: 0,
28
+ camelcase: 'off',
29
+ 'vue/max-attributes-per-line': 0,
30
+ 'vue/attribute-hyphenation': 0,
31
+ 'vue/html-self-closing': 0,
32
+ 'vue/component-name-in-template-casing': 0,
33
+ 'vue/html-closing-bracket-spacing': 0,
34
+ 'vue/singleline-html-element-content-newline': 0,
35
+ 'vue/no-unused-components': 0,
36
+ 'vue/multiline-html-element-content-newline': 0,
37
+ 'vue/no-use-v-if-with-v-for': 0,
38
+ 'vue/html-closing-bracket-newline': 0,
39
+ 'vue/no-parsing-error': 0,
40
+ 'vue/require-default-prop': 0,
41
+ 'vue/require-prop-types': 0,
42
+ quotes: [
43
+ 2,
44
+ 'single',
45
+ {
46
+ avoidEscape: true,
47
+ allowTemplateLiterals: true,
48
+ },
49
+ ],
50
+ semi: 0,
51
+ 'prefer-const': [
52
+ 2,
53
+ {
54
+ ignoreReadBeforeAssign: false,
55
+ },
56
+ ],
57
+ 'consistent-return': 'off',
58
+ 'max-len': 'off',
59
+ 'no-continue': 0,
60
+ 'linebreak-style': 'off',
61
+ 'default-case': 0,
62
+ radix: 0,
63
+ 'template-curly-spacing': 'off',
64
+ 'prefer-destructuring': 0,
65
+ },
66
+ parserOptions: {
67
+ parser: 'babel-eslint',
68
+ },
69
+ };
package/.prettierrc.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ printWidth: 120, // 超过最大值换行
3
+ tabWidth: 4,
4
+ semi: true, // 使用分号, 默认true
5
+ singleQuote: true, // 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号)
6
+ trailingComma: 'all', // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号)
7
+ bracketSpacing: true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }"
8
+ jsxBracketSameLine: false,
9
+ arrowParens: 'avoid', // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号
10
+ requirePragma: false,
11
+ proseWrap: 'preserve',
12
+ };
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # rk-web-core
2
+
3
+ > A Vue.js project
4
+
5
+ ## Build Setup
6
+
7
+ ``` bash
8
+ # install dependencies
9
+ npm install
10
+
11
+ # serve with hot reload at localhost:8080
12
+ npm run dev
13
+
14
+ # build for production with minification
15
+ npm run build
16
+ ```
17
+
18
+ For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>rk-web-core</title>
6
+ </head>
7
+ <body>
8
+ <div id="app"></div>
9
+ </body>
10
+ </html>
package/index.html CHANGED
@@ -1 +1,10 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"><title>rk-web-core</title><link href="./rk-web-core.css" rel="stylesheet"></head><body><div id="app"></div><script src="./rk-web-core.js"></script></body></html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>rk-web-core</title>
6
+ </head>
7
+ <body>
8
+ <div id="app"></div>
9
+ </body>
10
+ </html>
package/package.json CHANGED
@@ -1,62 +1,69 @@
1
- {
2
- "name": "rk-web-core",
3
- "description": "iep core utils",
4
- "version": "0.10.2",
5
- "author": "",
6
- "main": "rk-web-core.js",
7
- "scripts": {
8
- "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
9
- "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
10
- },
11
- "dependencies": {
12
- "vue": "^2.6.14",
13
- "store": "^2.0.12",
14
- "lodash": "^4.17.21",
15
- "nprogress": "^0.2.0",
16
- "vuex": "^3.4.0",
17
- "crypto-js": "^4.1.1",
18
- "vue-router": "^3.5.3",
19
- "@micro-zoe/micro-app": "^0.8.3",
20
- "axios": "^0.21.1",
21
- "rk-web-map": "^0.3.58"
22
- },
23
- "devDependencies": {
24
- "@babel/runtime": "^7.15.4",
25
- "babel-core": "^6.26.0",
26
- "babel-loader": "^7.1.5",
27
- "babel-plugin-dynamic-import-webpack": "^1.1.0",
28
- "babel-plugin-syntax-jsx": "^6.18.0",
29
- "babel-plugin-transform-class-properties": "^6.24.1",
30
- "babel-plugin-transform-object-assign": "^6.22.0",
31
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
32
- "babel-plugin-transform-runtime": "^6.23.0",
33
- "babel-plugin-transform-vue-jsx": "^3.7.0",
34
- "babel-preset-env": "^1.7.0",
35
- "babel-preset-stage-3": "^6.24.1",
36
- "classnames": "^2.3.1",
37
- "cross-env": "^7.0.3",
38
- "css-loader": "^3.0.0",
39
- "extract-css-chunks-webpack-plugin": "^4.9.0",
40
- "extract-text-webpack-plugin": "^3.0.2",
41
- "file-loader": "^6.2.0",
42
- "html-loader": "^1.3.0",
43
- "html-webpack-plugin": "^4.4.1",
44
- "less": "^3.9.0",
45
- "less-loader": "^6.0.0",
46
- "mini-css-extract-plugin": "^0.11.0",
47
- "optimize-css-assets-webpack-plugin": "^6.0.1",
48
- "uglifyjs-webpack-plugin": "^2.2.0",
49
- "vue-loader": "^15.6.2",
50
- "vue-svg-loader": "^0.16.0",
51
- "vue-template-compiler": "^2.6.14",
52
- "webpack": "^4.44.1",
53
- "webpack-cli": "^3.3.12",
54
- "webpack-dev-server": "^3.11.0",
55
- "webpackbar": "^4.0.0"
56
- },
57
- "browserslist": [
58
- "> 1%",
59
- "last 2 versions",
60
- "not ie <= 8"
61
- ]
62
- }
1
+ {
2
+ "name": "rk-web-core",
3
+ "description": "iep core utils",
4
+ "version": "0.10.3",
5
+ "author": "",
6
+ "main": "./src/core/index.js",
7
+ "scripts": {
8
+ "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
9
+ "build": "cross-env NODE_ENV=production webpack --progress"
10
+ },
11
+ "dependencies": {
12
+ "vue": "^2.6.14",
13
+ "store": "^2.0.12",
14
+ "lodash": "^4.17.21",
15
+ "nprogress": "^0.2.0",
16
+ "vuex": "^3.4.0",
17
+ "@micro-zoe/micro-app": "^0.8.5",
18
+ "vue-router": "^3.5.3",
19
+ "crypto-js": "^4.1.1",
20
+ "rk-web-map": "^0.3.58",
21
+ "axios": "^0.21.1",
22
+ "qs": "^6.10.3"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/runtime": "^7.15.4",
26
+ "@vue/eslint-config-prettier": "^6.0.0",
27
+ "babel-core": "^6.26.0",
28
+ "babel-eslint": "^10.1.0",
29
+ "babel-loader": "^7.1.5",
30
+ "babel-plugin-dynamic-import-webpack": "^1.1.0",
31
+ "babel-plugin-syntax-jsx": "^6.18.0",
32
+ "babel-plugin-transform-class-properties": "^6.24.1",
33
+ "babel-plugin-transform-object-assign": "^6.22.0",
34
+ "babel-plugin-transform-object-rest-spread": "^6.26.0",
35
+ "babel-plugin-transform-runtime": "^6.23.0",
36
+ "babel-plugin-transform-vue-jsx": "^3.7.0",
37
+ "babel-preset-env": "^1.7.0",
38
+ "babel-preset-stage-3": "^6.24.1",
39
+ "classnames": "^2.3.1",
40
+ "cross-env": "^7.0.3",
41
+ "css-loader": "^3.0.0",
42
+ "eslint": "^8.4.1",
43
+ "eslint-plugin-prettier": "^4.0.0",
44
+ "eslint-plugin-vue": "^8.2.0",
45
+ "extract-css-chunks-webpack-plugin": "^4.9.0",
46
+ "extract-text-webpack-plugin": "^3.0.2",
47
+ "file-loader": "^6.2.0",
48
+ "html-loader": "^1.3.0",
49
+ "html-webpack-plugin": "^4.4.1",
50
+ "less": "^3.9.0",
51
+ "less-loader": "^6.0.0",
52
+ "mini-css-extract-plugin": "^0.11.0",
53
+ "optimize-css-assets-webpack-plugin": "^6.0.1",
54
+ "uglifyjs-webpack-plugin": "^2.2.0",
55
+ "url-loader": "^4.1.1",
56
+ "vue-loader": "^15.6.2",
57
+ "vue-svg-loader": "^0.16.0",
58
+ "vue-template-compiler": "^2.6.14",
59
+ "webpack": "^4.44.1",
60
+ "webpack-cli": "^3.3.12",
61
+ "webpack-dev-server": "^3.11.0",
62
+ "webpackbar": "^4.0.0"
63
+ },
64
+ "browserslist": [
65
+ "> 1%",
66
+ "last 2 versions",
67
+ "not ie <= 8"
68
+ ]
69
+ }
package/src/App.vue ADDED
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div id="app"></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'app',
8
+ data () {
9
+ return {}
10
+ }
11
+ }
12
+ </script>
13
+
14
+ <style lang="less">
15
+ </style>
@@ -0,0 +1,19 @@
1
+ import MapNavLayout from '../layouts/MapNavLayout';
2
+ import BasicLayout from '../layouts/BasicLayout';
3
+ import MapWrapper from '../layouts/MapWrapper';
4
+ import NoSidebarWrapper from '../layouts/NoSidebarWrapper';
5
+ import SidebarWrapper from '../layouts/SidebarWrapper';
6
+ import AdminLayout from '../layouts/AdminLayout';
7
+ import FullHeaderLayout from '../layouts/FullHeaderLayout';
8
+ import BlankLayout from '../layouts/BlankLayout';
9
+
10
+ export default {
11
+ MapNavLayout,
12
+ BasicLayout,
13
+ MapWrapper,
14
+ NoSidebarWrapper,
15
+ SidebarWrapper,
16
+ AdminLayout,
17
+ FullHeaderLayout,
18
+ BlankLayout,
19
+ };
@@ -0,0 +1,6 @@
1
+ export const basicUrl = {
2
+ coreUrl:
3
+ 'https://daqilianfangliankong.obs.dualstack.cn-north-4.myhuaweicloud.com:443/iep-maptalks-core%2Fair-maptalks-core_core.js',
4
+ maptalksCss:
5
+ 'https://daqilianfangliankong.obs.dualstack.cn-north-4.myhuaweicloud.com:443/air-maptalks%2Fmaptalks.css',
6
+ };
@@ -0,0 +1,26 @@
1
+ import { isEmpty } from 'lodash';
2
+
3
+ const Action = {
4
+ name: 'action',
5
+ inserted: function (el, binding, vnode) {
6
+ const actionName = binding.arg;
7
+ const meta = vnode.context.$route.meta;
8
+ if (!isEmpty(meta) && !isEmpty(meta.permission)) {
9
+ const elVal = meta.permission;
10
+ const index = elVal.findIndex(item => actionName === item.toLowerCase());
11
+ if (index <= -1) {
12
+ (el.parentNode && el.parentNode.removeChild(el)) || (el.style.display = 'none');
13
+ } else {
14
+ return;
15
+ }
16
+ } else {
17
+ (el.parentNode && el.parentNode.removeChild(el)) || (el.style.display = 'none');
18
+ }
19
+ },
20
+ };
21
+
22
+ Action.install = function (Vue) {
23
+ Vue.directive(Action.name, Action);
24
+ };
25
+
26
+ export default Action;
@@ -0,0 +1,132 @@
1
+ import { isEmpty, pick } from 'lodash';
2
+ import { version } from './version';
3
+ import Router from 'vue-router';
4
+ import { pkRouter, routerInit } from './router';
5
+ import pkStore from './store';
6
+ import { registerPermission } from './router/permission';
7
+ import request from './service/request';
8
+ import { noLogin } from './router/noLogin';
9
+ import { mergeProps } from './utils/utils';
10
+ import axios from 'axios';
11
+ import { default as AppLayout } from './layouts/AppLayout';
12
+ import './layouts/style/index';
13
+ import rkMap, { GMap } from 'rk-web-map';
14
+ import micro, { microOne, microTwo, microThree } from './micro';
15
+ import Action from "./directives/action";
16
+
17
+ const basicOptions = {
18
+ loadView: undefined,
19
+ store: {},
20
+ filters: [],
21
+ vueConfig: {},
22
+ authToken: undefined,
23
+ svgFile: 'https://at.alicdn.com/t/font_614860_f0motpq03e.js',
24
+ isNeedMapTalks: false,
25
+ mapOptions: {},
26
+ routerOptions: {},
27
+ microOptions: {},
28
+ };
29
+
30
+ class RkCore {
31
+ constructor(vueInstance, options) {
32
+ if (vueInstance && options) {
33
+ this.vueInstance = vueInstance;
34
+ this.basicRouter = Router;
35
+ this.initOptions(options);
36
+ }
37
+ }
38
+
39
+ initOptions(e) {
40
+ const keys = Object.keys(basicOptions);
41
+ this.basicOptions = pick(mergeProps(basicOptions, e), keys);
42
+ this.storeInstance = this.basicOptions.store;
43
+ this.useInstance();
44
+ this.filterInstance();
45
+ this.vueConfigPick();
46
+ }
47
+
48
+ // 获取axios实例
49
+ getRequestInstance() {
50
+ return request;
51
+ }
52
+
53
+ useInstance() {
54
+ this.vueInstance.use(this.basicRouter);
55
+ this.vueInstance.use(Action);
56
+ this.routerInstance = routerInit(this.basicRouter, this.basicOptions.routerOptions);
57
+ this.storeInstance.registerModule('user', pkStore);
58
+ registerPermission(this, pkRouter(this.basicRouter, this.basicOptions.routerOptions));
59
+ if (this.basicOptions.isNeedMapTalks) {
60
+ this.loadAMap();
61
+ }
62
+ }
63
+
64
+ loadAMap() {
65
+ this.routerInstance.onReady(() => {
66
+ rkMap(
67
+ mergeProps(
68
+ {
69
+ svgFile: this.basicOptions.svgFile,
70
+ zoom: 9.6,
71
+ },
72
+ this.basicOptions.mapOptions,
73
+ ),
74
+ );
75
+ });
76
+ }
77
+
78
+ filterInstance() {
79
+ Object.keys(this.basicOptions.filters).forEach(filterName => {
80
+ this.vueInstance.filter(filterName, this.basicOptions.filters[filterName]);
81
+ });
82
+ }
83
+
84
+ vueConfigPick() {
85
+ const keys = Object.keys(this.basicOptions.vueConfig);
86
+ keys.forEach(e => {
87
+ this.vueInstance.config[e] = this.basicOptions.vueConfig[e];
88
+ });
89
+ }
90
+
91
+ mount() {
92
+ return {
93
+ version,
94
+ router: this.routerInstance,
95
+ store: this.storeInstance,
96
+ resetRouter: pkRouter(this.basicRouter),
97
+ request: this.getRequestInstance(),
98
+ axios,
99
+ vueInstance: this.vueInstance,
100
+ bootstrap: noLogin(this.routerInstance, this.basicOptions.authToken),
101
+ action: Action
102
+ };
103
+ }
104
+
105
+ loadMicro() {
106
+ return {
107
+ micro,
108
+ microOne,
109
+ microTwo,
110
+ microThree
111
+ }
112
+ }
113
+ }
114
+
115
+ const rkCore = (vueInstance, options) => {
116
+ return new RkCore(vueInstance, options);
117
+ };
118
+
119
+ const install = function(Vue) {
120
+ Vue.use(AppLayout);
121
+ };
122
+ /* istanbul ignore if */
123
+ if (typeof window !== 'undefined' && window.Vue) {
124
+ install(window.Vue);
125
+ }
126
+
127
+ AppLayout.install = function(Vue) {
128
+ Vue.component(AppLayout.name, AppLayout);
129
+ };
130
+ export { install, AppLayout, GMap };
131
+
132
+ export default rkCore;
@@ -0,0 +1,17 @@
1
+ export default {
2
+ render() {
3
+ return (
4
+ <a-result status="404" title="404" sub-title="Sorry, the page you visited does not exist.">
5
+ <a-button type="primary" slot="extra" onClick={this.toHome}>
6
+ Back Home
7
+ </a-button>
8
+ </a-result>
9
+ );
10
+ },
11
+ methods: {
12
+ toHome() {
13
+ this.$router.replace({ path: '/' });
14
+ return false;
15
+ },
16
+ },
17
+ };
@@ -0,0 +1,75 @@
1
+ import classNames from 'classnames';
2
+ import { prefixCls } from '../utils/polymerize';
3
+ import BlankLayout from './BlankLayout';
4
+ import AppLogo from './widget/AppLogo';
5
+ import Sidebar from './widget/Sidebar';
6
+ import AppExternal from './widget/AppExternal';
7
+ import HeaderInfoGroup from './widget/HeaderInfoGroup';
8
+
9
+ export default {
10
+ name: 'AdminLayout',
11
+ inject: ['slotsList'],
12
+ computed: {
13
+ nav() {
14
+ return this.$store.state.user.addRouters;
15
+ },
16
+ },
17
+ data() {
18
+ return {
19
+ sidebarList: [],
20
+ openKeys: [],
21
+ selectedKeys: [],
22
+ isOpen: true,
23
+ };
24
+ },
25
+ methods: {
26
+ handleSidebarChange(e) {
27
+ this.isOpen = e;
28
+ },
29
+ },
30
+ render() {
31
+ const basicLayoutClasses = classNames([
32
+ `${prefixCls}-layout-light`,
33
+ `${prefixCls}-basic-layout`,
34
+ `${prefixCls}-admin-layout`,
35
+ ]);
36
+ const headerClasses = classNames([
37
+ `${prefixCls}-header`,
38
+ `${prefixCls}-header-light`,
39
+ `${prefixCls}-header-light-header`,
40
+ !this.isOpen ? `${prefixCls}-header-between` : '',
41
+ ]);
42
+ const sidebarClasses = classNames([`${prefixCls}-slider-light`]);
43
+ return (
44
+ <a-layout class={basicLayoutClasses}>
45
+ <a-layout-sider class={`${prefixCls}-slider`} width={this.isOpen ? 250 : 0}>
46
+ {this.slotsList.logo ? this.slotsList.logo : <AppLogo prefix="basic" theme="light" />}
47
+ <Sidebar
48
+ sidebarList={this.nav[0].children}
49
+ class={sidebarClasses}
50
+ onChange={e => this.handleSidebarChange(e)}
51
+ />
52
+ </a-layout-sider>
53
+ <a-layout>
54
+ <a-layout-header class={headerClasses}>
55
+ {!this.isOpen ? (
56
+ this.slotsList.logo ? (
57
+ this.slotsList.logo
58
+ ) : (
59
+ <AppLogo prefix="basic" theme="light" />
60
+ )
61
+ ) : null}
62
+ <div class={[`${prefixCls}-header-light-inner`, `${prefixCls}-header-inner`]}>
63
+ {this.slotsList.header ? this.slotsList.header : null}
64
+ <AppExternal />
65
+ <HeaderInfoGroup />
66
+ </div>
67
+ </a-layout-header>
68
+ <a-layout-content>
69
+ <BlankLayout />
70
+ </a-layout-content>
71
+ </a-layout>
72
+ </a-layout>
73
+ );
74
+ },
75
+ };
@@ -0,0 +1,73 @@
1
+ import eventBus from '../utils/eventBus';
2
+
3
+ const AppLayout = {
4
+ name: 'AppLayout',
5
+ props: {
6
+ datetime: {
7
+ type: Boolean,
8
+ default: true,
9
+ },
10
+ weather: {
11
+ type: Boolean,
12
+ default: true,
13
+ },
14
+ wind: {
15
+ type: Boolean,
16
+ default: true,
17
+ },
18
+ keep: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ needMap: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ project: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ nav: {
31
+ type: Boolean,
32
+ default: true,
33
+ },
34
+ right: {
35
+ type: Boolean,
36
+ default: true,
37
+ }
38
+ },
39
+ provide() {
40
+ return {
41
+ slotsList: this.$slots,
42
+ propsList: this.$props,
43
+ instance: this,
44
+ };
45
+ },
46
+ mounted() {
47
+ eventBus.$on('loadMap', e => {
48
+ console.log('***************MAPTALKS*****************');
49
+ console.log(e);
50
+ console.log('***************MAPTALKS*****************');
51
+ this.$emit('load', e);
52
+ });
53
+ },
54
+ updated() {
55
+ this.$nextTick(() => {
56
+ this.$store.commit('user/SET_TIME_STAMP', {type: 'app', timeStamp: `${new Date().getTime()}`});
57
+ });
58
+ },
59
+ beforeDestroy() {
60
+ eventBus.$off('loadMap');
61
+ },
62
+ methods: {},
63
+ render() {
64
+ const {$slots} = this;
65
+ return <div class="rk-web-core-layout">{$slots.default}</div>;
66
+ },
67
+ };
68
+
69
+ AppLayout.install = function (Vue) {
70
+ Vue.component(AppLayout.name, AppLayout);
71
+ };
72
+
73
+ export default AppLayout;