vue2-client 1.2.0 → 1.2.1
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.
- package/README.md +65 -65
- package/babel.config.js +1 -0
- package/docs/notice.md +24 -0
- package/index.js +28 -28
- package/package.json +1 -1
- package/src/App.vue +93 -93
- package/src/base-client/all.js +57 -57
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1159 -1159
- package/src/base-client/components/common/CreateQuery/index.md +42 -42
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +540 -540
- package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
- package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +150 -150
- package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
- package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
- package/src/base-client/components/common/XAddForm/XAddForm.vue +323 -323
- package/src/base-client/components/common/XAddForm/index.md +60 -60
- package/src/base-client/components/common/XBadge/index.md +39 -39
- package/src/base-client/components/common/XCard/index.md +43 -43
- package/src/base-client/components/common/XForm/XForm.vue +275 -275
- package/src/base-client/components/common/XForm/XFormItem.vue +217 -217
- package/src/base-client/components/common/XForm/index.md +196 -196
- package/src/base-client/components/common/XFormCol/index.md +35 -35
- package/src/base-client/components/common/XFormTable/XFormTable.vue +405 -405
- package/src/base-client/components/common/XFormTable/index.md +89 -89
- package/src/base-client/components/common/XTable/XTable.vue +262 -262
- package/src/base-client/components/common/XTable/index.md +255 -255
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +105 -105
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +226 -226
- package/src/base-client/components/iot/CustomerDetailsView/index.md +41 -41
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +127 -127
- package/src/base-client/components/iot/DataAnalysisViewGD/DataAnalysisViewGD.vue +548 -548
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +453 -453
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +231 -231
- package/src/base-client/components/iot/DeviceDetailsView/index.md +43 -43
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +330 -330
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +122 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +225 -225
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +135 -135
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +277 -277
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +472 -472
- package/src/base-client/components/iot/InstructDetailsView/index.md +45 -45
- package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +380 -380
- package/src/base-client/components/iot/LogDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +360 -360
- package/src/base-client/components/iot/MeterDetailsView/index.md +43 -43
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +335 -335
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +185 -185
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +292 -292
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +237 -237
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +257 -257
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +190 -190
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +723 -723
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +48 -48
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
- package/src/base-client/components/system/DictionaryDetailsView/index.md +41 -41
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +248 -248
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +406 -406
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +486 -486
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +184 -184
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +303 -303
- package/src/base-client/plugins/AppData.js +69 -69
- package/src/base-client/plugins/GetLoginInfoService.js +221 -221
- package/src/base-client/plugins/index.js +21 -21
- package/src/bootstrap.js +27 -27
- package/src/components/Ellipsis/Ellipsis.vue +64 -64
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/Trend/index.md +45 -45
- package/src/components/cache/AKeepAlive.js +172 -172
- package/src/components/checkbox/index.js +7 -7
- package/src/components/index.js +36 -36
- package/src/components/menu/menu.js +273 -273
- package/src/components/setting/Setting.vue +237 -237
- package/src/components/table/advance/AdvanceTable.vue +275 -275
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +74 -74
- package/src/layouts/header/AdminHeader.vue +109 -109
- package/src/layouts/header/HeaderAvatar.vue +60 -60
- package/src/layouts/header/HeaderNotice.vue +97 -97
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +355 -355
- package/src/main.js +20 -20
- package/src/mock/goods/index.js +108 -108
- package/src/mock/index.js +12 -12
- package/src/mock/project/index.js +17 -17
- package/src/mock/user/current.js +13 -13
- package/src/mock/user/login.js +39 -39
- package/src/mock/workplace/index.js +15 -15
- package/src/pages/exception/403.vue +25 -25
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/exception/500.vue +25 -25
- package/src/pages/login/Login.vue +194 -194
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/resourceManageMain.vue +55 -55
- package/src/pages/system/applyInstallView/Core.vue +570 -570
- package/src/pages/system/applyInstallView/index.vue +34 -34
- package/src/pages/system/dictionary/index.vue +41 -41
- package/src/pages/system/queryParams/index.vue +41 -41
- package/src/router/async/config.async.js +25 -25
- package/src/router/async/router.map.js +59 -59
- package/src/router/guards.js +104 -104
- package/src/router/index.js +27 -27
- package/src/services/api/common.js +39 -39
- package/src/services/api/restTools.js +23 -23
- package/src/services/dataSource.js +12 -12
- package/src/services/user.js +34 -34
- package/src/store/modules/setting.js +114 -114
- package/src/utils/i18n.js +80 -80
- package/src/utils/indexedDB.js +146 -146
- package/src/utils/request.js +197 -197
- package/src/utils/routerUtil.js +15 -2
- package/tests/unit/ReportTable.spec.js +15 -15
- package/vue.config.js +153 -153
- package/webpack.config.js +12 -12
package/README.md
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
# vue2-client
|
|
2
|
-
|
|
3
|
-
基于Vue Antd Admin封装的通用基础组件
|
|
4
|
-
|
|
5
|
-
## 完整引入
|
|
6
|
-
|
|
7
|
-
```javascript
|
|
8
|
-
import Vue from 'vue'
|
|
9
|
-
import App from './App.vue'
|
|
10
|
-
import Router from 'vue-router'
|
|
11
|
-
import Vuex from 'vuex'
|
|
12
|
-
import '@vue2-client/mock'
|
|
13
|
-
import { routerOptions, modules, i18n, message, bootstrap } from 'vue2-client'
|
|
14
|
-
|
|
15
|
-
Vue.use(Router)
|
|
16
|
-
Vue.use(Vuex)
|
|
17
|
-
// 创建router store
|
|
18
|
-
const store = new Vuex.Store({ modules })
|
|
19
|
-
const router = new Router(routerOptions)
|
|
20
|
-
|
|
21
|
-
bootstrap({ router, store, i18n, message })
|
|
22
|
-
new Vue({
|
|
23
|
-
router,
|
|
24
|
-
store,
|
|
25
|
-
i18n,
|
|
26
|
-
render: h => h(App)
|
|
27
|
-
}).$mount('#app')
|
|
28
|
-
|
|
29
|
-
注意引入项目请添加webpack别名配置
|
|
30
|
-
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'node_modules/vue2-client/src'))
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 目录结构
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
├── docs # 文档
|
|
37
|
-
├── public
|
|
38
|
-
│ └── favicon.png # favicon
|
|
39
|
-
│ └── index.html # 入口 HTML
|
|
40
|
-
├── src
|
|
41
|
-
│ ├── assets # 本地静态资源
|
|
42
|
-
│ ├── base-client # 基础组件和基础vue插件(全局注册)
|
|
43
|
-
│ ├── components # 内置通用组件(按需引入)
|
|
44
|
-
│ ├── config # 系统配置
|
|
45
|
-
│ ├── layouts # 通用布局组件(按需引入)
|
|
46
|
-
│ ├── mock # 本地 mock 数据
|
|
47
|
-
│ ├── pages # 页面组件
|
|
48
|
-
│ ├── router # 路由配置
|
|
49
|
-
│ ├── services # 数据服务模块
|
|
50
|
-
│ ├── store # vuex 状态管理配置
|
|
51
|
-
│ ├── theme # 主题样式相关
|
|
52
|
-
│ ├── utils # js 工具
|
|
53
|
-
│ ├── App.vue # 应用入口组件
|
|
54
|
-
│ ├── bootstrap.js # 应用启动引导js
|
|
55
|
-
│ ├── index.js # 应用导出js
|
|
56
|
-
│ └── main.js # 应用入口js
|
|
57
|
-
├── tests # 单元测试
|
|
58
|
-
├── package.json # package.json
|
|
59
|
-
├── README.md # README.md
|
|
60
|
-
└── vue.config.js # vue 配置文件
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## 文档入口
|
|
64
|
-
|
|
65
|
-
[入口](docs/index.md)
|
|
1
|
+
# vue2-client
|
|
2
|
+
|
|
3
|
+
基于Vue Antd Admin封装的通用基础组件
|
|
4
|
+
|
|
5
|
+
## 完整引入
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
import Vue from 'vue'
|
|
9
|
+
import App from './App.vue'
|
|
10
|
+
import Router from 'vue-router'
|
|
11
|
+
import Vuex from 'vuex'
|
|
12
|
+
import '@vue2-client/mock'
|
|
13
|
+
import { routerOptions, modules, i18n, message, bootstrap } from 'vue2-client'
|
|
14
|
+
|
|
15
|
+
Vue.use(Router)
|
|
16
|
+
Vue.use(Vuex)
|
|
17
|
+
// 创建router store
|
|
18
|
+
const store = new Vuex.Store({ modules })
|
|
19
|
+
const router = new Router(routerOptions)
|
|
20
|
+
|
|
21
|
+
bootstrap({ router, store, i18n, message })
|
|
22
|
+
new Vue({
|
|
23
|
+
router,
|
|
24
|
+
store,
|
|
25
|
+
i18n,
|
|
26
|
+
render: h => h(App)
|
|
27
|
+
}).$mount('#app')
|
|
28
|
+
|
|
29
|
+
注意引入项目请添加webpack别名配置
|
|
30
|
+
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'node_modules/vue2-client/src'))
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 目录结构
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
├── docs # 文档
|
|
37
|
+
├── public
|
|
38
|
+
│ └── favicon.png # favicon
|
|
39
|
+
│ └── index.html # 入口 HTML
|
|
40
|
+
├── src
|
|
41
|
+
│ ├── assets # 本地静态资源
|
|
42
|
+
│ ├── base-client # 基础组件和基础vue插件(全局注册)
|
|
43
|
+
│ ├── components # 内置通用组件(按需引入)
|
|
44
|
+
│ ├── config # 系统配置
|
|
45
|
+
│ ├── layouts # 通用布局组件(按需引入)
|
|
46
|
+
│ ├── mock # 本地 mock 数据
|
|
47
|
+
│ ├── pages # 页面组件
|
|
48
|
+
│ ├── router # 路由配置
|
|
49
|
+
│ ├── services # 数据服务模块
|
|
50
|
+
│ ├── store # vuex 状态管理配置
|
|
51
|
+
│ ├── theme # 主题样式相关
|
|
52
|
+
│ ├── utils # js 工具
|
|
53
|
+
│ ├── App.vue # 应用入口组件
|
|
54
|
+
│ ├── bootstrap.js # 应用启动引导js
|
|
55
|
+
│ ├── index.js # 应用导出js
|
|
56
|
+
│ └── main.js # 应用入口js
|
|
57
|
+
├── tests # 单元测试
|
|
58
|
+
├── package.json # package.json
|
|
59
|
+
├── README.md # README.md
|
|
60
|
+
└── vue.config.js # vue 配置文件
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 文档入口
|
|
64
|
+
|
|
65
|
+
[入口](docs/index.md)
|
package/babel.config.js
CHANGED
package/docs/notice.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 开发规范(持续跟新)
|
|
2
|
+
## 引入各种文件时,必须写绝对路径, 不允许写相对路径
|
|
3
|
+
```js
|
|
4
|
+
// 引自己项目时文件时, @ 表示自己项目的src目录
|
|
5
|
+
import('@/pages/safeguard/list/search/UserFiles')
|
|
6
|
+
// 引入vue2-client项目文件时, @vue2-client: 表示@vue2-client下的src目录
|
|
7
|
+
import { post } from '@vue2-client/services/api/restTools'
|
|
8
|
+
```
|
|
9
|
+
## 编写vue文件的样式时, 必须使用less, 样式必须在最外层添加当前页面html的id, id与vue文件名相同
|
|
10
|
+
```vue
|
|
11
|
+
helloWorld.vue
|
|
12
|
+
<template>
|
|
13
|
+
<div id="helloWorld">
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style lang="less">
|
|
19
|
+
#helloWorld{
|
|
20
|
+
/*写自己的样式*/
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
```
|
|
24
|
+
|
package/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { initRouter } from '@vue2-client/router'
|
|
3
|
-
import { initI18n } from '@vue2-client/utils/i18n'
|
|
4
|
-
import bootstrap from '@vue2-client/bootstrap'
|
|
5
|
-
import { modules } from '@vue2-client/store'
|
|
6
|
-
import '@vue2-client/theme/index.less'
|
|
7
|
-
import '@vue2-client/base-client/all'
|
|
8
|
-
import '@vue2-client/utils/filter'
|
|
9
|
-
import 'animate.css/source/animate.css'
|
|
10
|
-
import 'moment/locale/zh-cn'
|
|
11
|
-
import Antd from 'ant-design-vue'
|
|
12
|
-
import Viser from 'viser-vue'
|
|
13
|
-
|
|
14
|
-
const routerOptions = initRouter()
|
|
15
|
-
const i18n = initI18n('CN', 'US')
|
|
16
|
-
|
|
17
|
-
Vue.use(Antd)
|
|
18
|
-
Vue.use(Viser)
|
|
19
|
-
Vue.config.productionTip = false
|
|
20
|
-
const message = Vue.prototype.$message
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
routerOptions,
|
|
24
|
-
modules,
|
|
25
|
-
i18n,
|
|
26
|
-
message,
|
|
27
|
-
bootstrap
|
|
28
|
-
}
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { initRouter } from '@vue2-client/router'
|
|
3
|
+
import { initI18n } from '@vue2-client/utils/i18n'
|
|
4
|
+
import bootstrap from '@vue2-client/bootstrap'
|
|
5
|
+
import { modules } from '@vue2-client/store'
|
|
6
|
+
import '@vue2-client/theme/index.less'
|
|
7
|
+
import '@vue2-client/base-client/all'
|
|
8
|
+
import '@vue2-client/utils/filter'
|
|
9
|
+
import 'animate.css/source/animate.css'
|
|
10
|
+
import 'moment/locale/zh-cn'
|
|
11
|
+
import Antd from 'ant-design-vue'
|
|
12
|
+
import Viser from 'viser-vue'
|
|
13
|
+
|
|
14
|
+
const routerOptions = initRouter()
|
|
15
|
+
const i18n = initI18n('CN', 'US')
|
|
16
|
+
|
|
17
|
+
Vue.use(Antd)
|
|
18
|
+
Vue.use(Viser)
|
|
19
|
+
Vue.config.productionTip = false
|
|
20
|
+
const message = Vue.prototype.$message
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
routerOptions,
|
|
24
|
+
modules,
|
|
25
|
+
i18n,
|
|
26
|
+
message,
|
|
27
|
+
bootstrap
|
|
28
|
+
}
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-config-provider :locale="locale" :get-popup-container="popContainer">
|
|
3
|
-
<router-view/>
|
|
4
|
-
</a-config-provider>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { enquireScreen } from './utils/util'
|
|
9
|
-
import { mapState, mapMutations } from 'vuex'
|
|
10
|
-
import themeUtil from '@vue2-client/utils/themeUtil'
|
|
11
|
-
import { getI18nKey } from '@vue2-client/utils/routerUtil'
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
name: 'App',
|
|
15
|
-
data () {
|
|
16
|
-
return {
|
|
17
|
-
locale: {}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
created () {
|
|
21
|
-
this.setHtmlTitle()
|
|
22
|
-
this.setLanguage(this.lang)
|
|
23
|
-
enquireScreen(isMobile => this.setDevice(isMobile))
|
|
24
|
-
},
|
|
25
|
-
mounted () {
|
|
26
|
-
this.setWeekModeTheme(this.weekMode)
|
|
27
|
-
},
|
|
28
|
-
watch: {
|
|
29
|
-
weekMode (val) {
|
|
30
|
-
this.setWeekModeTheme(val)
|
|
31
|
-
},
|
|
32
|
-
lang (val) {
|
|
33
|
-
this.setLanguage(val)
|
|
34
|
-
this.setHtmlTitle()
|
|
35
|
-
},
|
|
36
|
-
$route () {
|
|
37
|
-
this.setHtmlTitle()
|
|
38
|
-
},
|
|
39
|
-
'theme.mode': function (val) {
|
|
40
|
-
const closeMessage = this.$message.loading(`您选择了主题模式 ${val}, 正在切换...`)
|
|
41
|
-
themeUtil.changeThemeColor(this.theme.color, val).then(closeMessage)
|
|
42
|
-
},
|
|
43
|
-
'theme.color': function (val) {
|
|
44
|
-
const closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
|
|
45
|
-
themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
|
|
46
|
-
},
|
|
47
|
-
'layout': function () {
|
|
48
|
-
window.dispatchEvent(new Event('resize'))
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
computed: {
|
|
52
|
-
...mapState('setting', ['layout', 'theme', 'weekMode', 'lang'])
|
|
53
|
-
},
|
|
54
|
-
methods: {
|
|
55
|
-
...mapMutations('setting', ['setDevice']),
|
|
56
|
-
setWeekModeTheme (weekMode) {
|
|
57
|
-
if (weekMode) {
|
|
58
|
-
document.body.classList.add('week-mode')
|
|
59
|
-
} else {
|
|
60
|
-
document.body.classList.remove('week-mode')
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
setLanguage (lang) {
|
|
64
|
-
this.$i18n.locale = lang
|
|
65
|
-
switch (lang) {
|
|
66
|
-
case 'CN':
|
|
67
|
-
this.locale = require('ant-design-vue/es/locale-provider/zh_CN').default
|
|
68
|
-
break
|
|
69
|
-
case 'HK':
|
|
70
|
-
this.locale = require('ant-design-vue/es/locale-provider/zh_TW').default
|
|
71
|
-
break
|
|
72
|
-
case 'US':
|
|
73
|
-
default:
|
|
74
|
-
this.locale = require('ant-design-vue/es/locale-provider/en_US').default
|
|
75
|
-
break
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
setHtmlTitle () {
|
|
79
|
-
const route = this.$route
|
|
80
|
-
const key = route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path)
|
|
81
|
-
document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key)
|
|
82
|
-
},
|
|
83
|
-
popContainer () {
|
|
84
|
-
return document.getElementById('popContainer')
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
89
|
-
|
|
90
|
-
<style lang="less" scoped>
|
|
91
|
-
#id{
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-config-provider :locale="locale" :get-popup-container="popContainer">
|
|
3
|
+
<router-view/>
|
|
4
|
+
</a-config-provider>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { enquireScreen } from './utils/util'
|
|
9
|
+
import { mapState, mapMutations } from 'vuex'
|
|
10
|
+
import themeUtil from '@vue2-client/utils/themeUtil'
|
|
11
|
+
import { getI18nKey } from '@vue2-client/utils/routerUtil'
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'App',
|
|
15
|
+
data () {
|
|
16
|
+
return {
|
|
17
|
+
locale: {}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
created () {
|
|
21
|
+
this.setHtmlTitle()
|
|
22
|
+
this.setLanguage(this.lang)
|
|
23
|
+
enquireScreen(isMobile => this.setDevice(isMobile))
|
|
24
|
+
},
|
|
25
|
+
mounted () {
|
|
26
|
+
this.setWeekModeTheme(this.weekMode)
|
|
27
|
+
},
|
|
28
|
+
watch: {
|
|
29
|
+
weekMode (val) {
|
|
30
|
+
this.setWeekModeTheme(val)
|
|
31
|
+
},
|
|
32
|
+
lang (val) {
|
|
33
|
+
this.setLanguage(val)
|
|
34
|
+
this.setHtmlTitle()
|
|
35
|
+
},
|
|
36
|
+
$route () {
|
|
37
|
+
this.setHtmlTitle()
|
|
38
|
+
},
|
|
39
|
+
'theme.mode': function (val) {
|
|
40
|
+
const closeMessage = this.$message.loading(`您选择了主题模式 ${val}, 正在切换...`)
|
|
41
|
+
themeUtil.changeThemeColor(this.theme.color, val).then(closeMessage)
|
|
42
|
+
},
|
|
43
|
+
'theme.color': function (val) {
|
|
44
|
+
const closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
|
|
45
|
+
themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
|
|
46
|
+
},
|
|
47
|
+
'layout': function () {
|
|
48
|
+
window.dispatchEvent(new Event('resize'))
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
...mapState('setting', ['layout', 'theme', 'weekMode', 'lang'])
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
...mapMutations('setting', ['setDevice']),
|
|
56
|
+
setWeekModeTheme (weekMode) {
|
|
57
|
+
if (weekMode) {
|
|
58
|
+
document.body.classList.add('week-mode')
|
|
59
|
+
} else {
|
|
60
|
+
document.body.classList.remove('week-mode')
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
setLanguage (lang) {
|
|
64
|
+
this.$i18n.locale = lang
|
|
65
|
+
switch (lang) {
|
|
66
|
+
case 'CN':
|
|
67
|
+
this.locale = require('ant-design-vue/es/locale-provider/zh_CN').default
|
|
68
|
+
break
|
|
69
|
+
case 'HK':
|
|
70
|
+
this.locale = require('ant-design-vue/es/locale-provider/zh_TW').default
|
|
71
|
+
break
|
|
72
|
+
case 'US':
|
|
73
|
+
default:
|
|
74
|
+
this.locale = require('ant-design-vue/es/locale-provider/en_US').default
|
|
75
|
+
break
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
setHtmlTitle () {
|
|
79
|
+
const route = this.$route
|
|
80
|
+
const key = route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path)
|
|
81
|
+
document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key)
|
|
82
|
+
},
|
|
83
|
+
popContainer () {
|
|
84
|
+
return document.getElementById('popContainer')
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="less" scoped>
|
|
91
|
+
#id{
|
|
92
|
+
}
|
|
93
|
+
</style>
|
package/src/base-client/all.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
|
|
3
|
-
import CustomColumnsDrawer from '@vue2-client/base-client/components/common/CustomColumnsDrawer'
|
|
4
|
-
import InstructDetailsView from '@vue2-client/base-client/components/iot/InstructDetailsView'
|
|
5
|
-
import MeterDetailsView from '@vue2-client/base-client/components/iot/MeterDetailsView'
|
|
6
|
-
import CustomerDetailsView from '@vue2-client/base-client/components/iot/CustomerDetailsView'
|
|
7
|
-
import LogDetailsView from '@vue2-client/base-client/components/iot/LogDetailsView'
|
|
8
|
-
import WebmeterAnalysisView from '@vue2-client/base-client/components/iot/WebmeterAnalysisView'
|
|
9
|
-
import XCard from '@vue2-client/base-client/components/common/XCard/XCard'
|
|
10
|
-
import XFormCol from '@vue2-client/base-client/components/common/XFormCol'
|
|
11
|
-
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
12
|
-
import DataAnalysisView from '@vue2-client/base-client/components/iot/DataAnalysisView'
|
|
13
|
-
import DataAnalysisUser from '@vue2-client/base-client/components/iot/DataAnalysisUser'
|
|
14
|
-
import DataAnalysisViewGD from '@vue2-client/base-client/components/iot/DataAnalysisViewGD'
|
|
15
|
-
import DeviceTypeDetailsView from '@vue2-client/base-client/components/iot/DeviceTypeDetailsView'
|
|
16
|
-
import DeviceBrandDetailsView from '@vue2-client/base-client/components/iot/DeviceBrandDetailsView'
|
|
17
|
-
import DictionaryDetailsView from '@vue2-client/base-client/components/system/DictionaryDetailsView'
|
|
18
|
-
import QueryParamsDetailsView from '@vue2-client/base-client/components/system/QueryParamsDetailsView'
|
|
19
|
-
import DeviceDetailsView from '@vue2-client/base-client/components/iot/DeviceDetailsView'
|
|
20
|
-
import TicketDetailsView from '@vue2-client/base-client/components/ticket/TicketDetailsView'
|
|
21
|
-
import EmployeeDetailsView from '@vue2-client/base-client/components/ticket/EmployeeDetailsView'
|
|
22
|
-
import submitTicketSuccess from '@vue2-client/base-client/components/ticket/TicketSubmitSuccessView'
|
|
23
|
-
import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
|
|
24
|
-
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
25
|
-
import FormGroupQuery from '@vue2-client/base-client/components/common/FormGroupQuery'
|
|
26
|
-
import FormGroupEdit from '@vue2-client/base-client/components/common/FormGroupEdit'
|
|
27
|
-
import JSONToTree from '@vue2-client/base-client/components/common/JSONToTree'
|
|
28
|
-
|
|
29
|
-
// 插件
|
|
30
|
-
import Plugins from '@vue2-client/base-client/plugins'
|
|
31
|
-
Vue.use(Plugins)
|
|
32
|
-
|
|
33
|
-
Vue.component('custom-columns-drawer', CustomColumnsDrawer)
|
|
34
|
-
Vue.component('InstructDetailsView', InstructDetailsView)
|
|
35
|
-
Vue.component('MeterDetailsView', MeterDetailsView)
|
|
36
|
-
Vue.component('CustomerDetailsView', CustomerDetailsView)
|
|
37
|
-
Vue.component('LogDetailsView', LogDetailsView)
|
|
38
|
-
Vue.component('WebmeterAnalysisView', WebmeterAnalysisView)
|
|
39
|
-
Vue.component('XCard', XCard)
|
|
40
|
-
Vue.component('XBadge', XBadge)
|
|
41
|
-
Vue.component('XFormCol', XFormCol)
|
|
42
|
-
Vue.component('DataAnalysisView', DataAnalysisView)
|
|
43
|
-
Vue.component('DataAnalysisUser', DataAnalysisUser)
|
|
44
|
-
Vue.component('DataAnalysisViewGD', DataAnalysisViewGD)
|
|
45
|
-
Vue.component('DeviceTypeDetailsView', DeviceTypeDetailsView)
|
|
46
|
-
Vue.component('DeviceBrandDetailsView', DeviceBrandDetailsView)
|
|
47
|
-
Vue.component('DeviceDetailsView', DeviceDetailsView)
|
|
48
|
-
Vue.component('DictionaryDetailsView', DictionaryDetailsView)
|
|
49
|
-
Vue.component('QueryParamsDetailsView', QueryParamsDetailsView)
|
|
50
|
-
Vue.component('TicketDetailsView', TicketDetailsView)
|
|
51
|
-
Vue.component('EmployeeDetailsView', EmployeeDetailsView)
|
|
52
|
-
Vue.component('submitTicketSuccess', submitTicketSuccess)
|
|
53
|
-
Vue.component('CreateQuery', CreateQuery)
|
|
54
|
-
Vue.component('CreateSimpleFormQuery', CreateSimpleFormQuery)
|
|
55
|
-
Vue.component('FormGroupQuery', FormGroupQuery)
|
|
56
|
-
Vue.component('FormGroupEdit', FormGroupEdit)
|
|
57
|
-
Vue.component('JSONToTree', JSONToTree)
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
|
|
3
|
+
import CustomColumnsDrawer from '@vue2-client/base-client/components/common/CustomColumnsDrawer'
|
|
4
|
+
import InstructDetailsView from '@vue2-client/base-client/components/iot/InstructDetailsView'
|
|
5
|
+
import MeterDetailsView from '@vue2-client/base-client/components/iot/MeterDetailsView'
|
|
6
|
+
import CustomerDetailsView from '@vue2-client/base-client/components/iot/CustomerDetailsView'
|
|
7
|
+
import LogDetailsView from '@vue2-client/base-client/components/iot/LogDetailsView'
|
|
8
|
+
import WebmeterAnalysisView from '@vue2-client/base-client/components/iot/WebmeterAnalysisView'
|
|
9
|
+
import XCard from '@vue2-client/base-client/components/common/XCard/XCard'
|
|
10
|
+
import XFormCol from '@vue2-client/base-client/components/common/XFormCol'
|
|
11
|
+
import XBadge from '@vue2-client/base-client/components/common/XBadge'
|
|
12
|
+
import DataAnalysisView from '@vue2-client/base-client/components/iot/DataAnalysisView'
|
|
13
|
+
import DataAnalysisUser from '@vue2-client/base-client/components/iot/DataAnalysisUser'
|
|
14
|
+
import DataAnalysisViewGD from '@vue2-client/base-client/components/iot/DataAnalysisViewGD'
|
|
15
|
+
import DeviceTypeDetailsView from '@vue2-client/base-client/components/iot/DeviceTypeDetailsView'
|
|
16
|
+
import DeviceBrandDetailsView from '@vue2-client/base-client/components/iot/DeviceBrandDetailsView'
|
|
17
|
+
import DictionaryDetailsView from '@vue2-client/base-client/components/system/DictionaryDetailsView'
|
|
18
|
+
import QueryParamsDetailsView from '@vue2-client/base-client/components/system/QueryParamsDetailsView'
|
|
19
|
+
import DeviceDetailsView from '@vue2-client/base-client/components/iot/DeviceDetailsView'
|
|
20
|
+
import TicketDetailsView from '@vue2-client/base-client/components/ticket/TicketDetailsView'
|
|
21
|
+
import EmployeeDetailsView from '@vue2-client/base-client/components/ticket/EmployeeDetailsView'
|
|
22
|
+
import submitTicketSuccess from '@vue2-client/base-client/components/ticket/TicketSubmitSuccessView'
|
|
23
|
+
import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
|
|
24
|
+
import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
|
|
25
|
+
import FormGroupQuery from '@vue2-client/base-client/components/common/FormGroupQuery'
|
|
26
|
+
import FormGroupEdit from '@vue2-client/base-client/components/common/FormGroupEdit'
|
|
27
|
+
import JSONToTree from '@vue2-client/base-client/components/common/JSONToTree'
|
|
28
|
+
|
|
29
|
+
// 插件
|
|
30
|
+
import Plugins from '@vue2-client/base-client/plugins'
|
|
31
|
+
Vue.use(Plugins)
|
|
32
|
+
|
|
33
|
+
Vue.component('custom-columns-drawer', CustomColumnsDrawer)
|
|
34
|
+
Vue.component('InstructDetailsView', InstructDetailsView)
|
|
35
|
+
Vue.component('MeterDetailsView', MeterDetailsView)
|
|
36
|
+
Vue.component('CustomerDetailsView', CustomerDetailsView)
|
|
37
|
+
Vue.component('LogDetailsView', LogDetailsView)
|
|
38
|
+
Vue.component('WebmeterAnalysisView', WebmeterAnalysisView)
|
|
39
|
+
Vue.component('XCard', XCard)
|
|
40
|
+
Vue.component('XBadge', XBadge)
|
|
41
|
+
Vue.component('XFormCol', XFormCol)
|
|
42
|
+
Vue.component('DataAnalysisView', DataAnalysisView)
|
|
43
|
+
Vue.component('DataAnalysisUser', DataAnalysisUser)
|
|
44
|
+
Vue.component('DataAnalysisViewGD', DataAnalysisViewGD)
|
|
45
|
+
Vue.component('DeviceTypeDetailsView', DeviceTypeDetailsView)
|
|
46
|
+
Vue.component('DeviceBrandDetailsView', DeviceBrandDetailsView)
|
|
47
|
+
Vue.component('DeviceDetailsView', DeviceDetailsView)
|
|
48
|
+
Vue.component('DictionaryDetailsView', DictionaryDetailsView)
|
|
49
|
+
Vue.component('QueryParamsDetailsView', QueryParamsDetailsView)
|
|
50
|
+
Vue.component('TicketDetailsView', TicketDetailsView)
|
|
51
|
+
Vue.component('EmployeeDetailsView', EmployeeDetailsView)
|
|
52
|
+
Vue.component('submitTicketSuccess', submitTicketSuccess)
|
|
53
|
+
Vue.component('CreateQuery', CreateQuery)
|
|
54
|
+
Vue.component('CreateSimpleFormQuery', CreateSimpleFormQuery)
|
|
55
|
+
Vue.component('FormGroupQuery', FormGroupQuery)
|
|
56
|
+
Vue.component('FormGroupEdit', FormGroupEdit)
|
|
57
|
+
Vue.component('JSONToTree', JSONToTree)
|