vue2-client 1.2.47 → 1.2.48

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.
@@ -1,67 +1,57 @@
1
- import { manageApi, post } from '@vue2-client/services/api'
2
-
3
- const GetAppDataService = {
4
- install (Vue) {
5
- // 给vue增添对话框显示方法
6
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
7
- },
8
- async load () {
9
- const params = {}
10
- // 查询燃气公司列表
11
- const orgList = []
12
- await post(manageApi.orgList, {}).then(async res => {
13
- for (let i = 0, len = res.length; i < len; i++) {
14
- orgList.push({
15
- label: res[i],
16
- value: res[i],
17
- text: res[i]
18
- })
19
- }
20
- params['orgList'] = orgList
21
- await post(manageApi.getDictionaryValue, {}).then((res) => {
22
- Object.assign(params, res)
23
- const badgeItemArray = {}
24
- for (const key of Object.keys(params)) {
25
- badgeItemArray[key] = {}
26
- for (const item of params[key]) {
27
- if (item.status) {
28
- badgeItemArray[key][item.value] = {
29
- status: item.status,
30
- text: item.text
31
- }
32
- }
33
- }
34
- }
35
- // 追加参数
36
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
37
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
38
- })
39
- })
40
- },
41
- getDictionaryList (key) {
42
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
43
- const object = JSON.parse(str)
44
- return object[key]
45
- },
46
- getParam (key, value) {
47
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
48
- const object = JSON.parse(str)
49
- const result = object[key]
50
- if (result && result.hasOwnProperty(value)) {
51
- return result[value]
52
- } else {
53
- return null
54
- }
55
- },
56
- getParams () {
57
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
58
- const object = JSON.parse(str)
59
- return object
60
- },
61
- getSingleValues () {
62
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
63
- const object = JSON.parse(str)
64
- return object
65
- }
66
- }
67
- export default GetAppDataService
1
+ import { manageApi, post } from '@vue2-client/services/api'
2
+
3
+ const GetAppDataService = {
4
+ install (Vue) {
5
+ // 给vue增添对话框显示方法
6
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
7
+ },
8
+ async load () {
9
+ const params = {
10
+ orgList: []
11
+ }
12
+ await post(manageApi.getDictionaryValue, {}).then((res) => {
13
+ Object.assign(params, res)
14
+ const badgeItemArray = {}
15
+ for (const key of Object.keys(params)) {
16
+ badgeItemArray[key] = {}
17
+ for (const item of params[key]) {
18
+ if (item.status) {
19
+ badgeItemArray[key][item.value] = {
20
+ status: item.status,
21
+ text: item.text
22
+ }
23
+ }
24
+ }
25
+ }
26
+ // 追加参数
27
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
28
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
29
+ })
30
+ },
31
+ getDictionaryList (key) {
32
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
33
+ const object = JSON.parse(str)
34
+ return object[key]
35
+ },
36
+ getParam (key, value) {
37
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
38
+ const object = JSON.parse(str)
39
+ const result = object[key]
40
+ if (result && result.hasOwnProperty(value)) {
41
+ return result[value]
42
+ } else {
43
+ return null
44
+ }
45
+ },
46
+ getParams () {
47
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
48
+ const object = JSON.parse(str)
49
+ return object
50
+ },
51
+ getSingleValues () {
52
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
53
+ const object = JSON.parse(str)
54
+ return object
55
+ }
56
+ }
57
+ export default GetAppDataService
@@ -1,97 +1,96 @@
1
- <template>
2
- <a-dropdown :trigger="['click']" v-model="show">
3
- <div slot="overlay">
4
- <a-spin :spinning="loading">
5
- <a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
6
- <a-tab-pane tab="通知" key="1">
7
- <a-list>
8
- <a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
9
- <a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
10
- <a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
11
- </a-list-item-meta>
12
- </a-list-item>
13
- </a-list>
14
- </a-tab-pane>
15
- <a-tab-pane tab="消息" key="2">
16
- <a-list class="tab-pane"></a-list>
17
- </a-tab-pane>
18
- <a-tab-pane tab="待办" key="3">
19
- <a-list class="tab-pane"></a-list>
20
- </a-tab-pane>
21
- </a-tabs>
22
- </a-spin>
23
- </div>
24
- <span @click="fetchNotice" class="header-notice">
25
- <a-badge class="notice-badge" :count=" exception.length">
26
- <a-icon :class="['header-notice-icon']" type="bell" />
27
- </a-badge>
28
- </span>
29
- </a-dropdown>
30
- </template>
31
-
32
- <script>
33
- import { post } from '@vue2-client/services/api'
34
- export default {
35
- name: 'HeaderNotice',
36
- data () {
37
- return {
38
- loading: false,
39
- show: false,
40
- exception: []
41
- }
42
- },
43
- computed: {
44
- },
45
- created () {
46
- this.refresh()
47
- },
48
- methods: {
49
- read (item) {
50
- post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
51
- this.refresh()
52
- })
53
- },
54
- refresh () {
55
- post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
56
- this.exception = res.data
57
- })
58
- },
59
- fetchNotice () {
60
- if (this.loading) {
61
- this.loading = false
62
- return
63
- }
64
- this.loadding = true
65
- setTimeout(() => {
66
- this.loadding = false
67
- }, 1000)
68
- }
69
- }
70
- }
71
- </script>
72
-
73
- <style lang="less">
74
- .header-notice{
75
- display: inline-block;
76
- transition: all 0.3s;
77
- span {
78
- vertical-align: initial;
79
- }
80
- .notice-badge{
81
- color: inherit;
82
- .header-notice-icon{
83
- font-size: 16px;
84
- padding: 4px;
85
- }
86
- }
87
- }
88
- .dropdown-tabs{
89
- background-color: @base-bg-color;
90
- box-shadow: 0 2px 8px @shadow-color;
91
- border-radius: 4px;
92
- .tab-pane{
93
- padding: 0 24px 12px;
94
- min-height: 250px;
95
- }
96
- }
97
- </style>
1
+ <template>
2
+ <a-dropdown :trigger="['click']" v-model="show">
3
+ <div slot="overlay">
4
+ <a-spin :spinning="loading">
5
+ <a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
6
+ <a-tab-pane tab="通知" key="1">
7
+ <a-list>
8
+ <a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
9
+ <a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
10
+ <a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
11
+ </a-list-item-meta>
12
+ </a-list-item>
13
+ </a-list>
14
+ </a-tab-pane>
15
+ <a-tab-pane tab="消息" key="2">
16
+ <a-list class="tab-pane"></a-list>
17
+ </a-tab-pane>
18
+ <a-tab-pane tab="待办" key="3">
19
+ <a-list class="tab-pane"></a-list>
20
+ </a-tab-pane>
21
+ </a-tabs>
22
+ </a-spin>
23
+ </div>
24
+ <span @click="fetchNotice" class="header-notice">
25
+ <a-badge class="notice-badge" :count=" exception.length">
26
+ <a-icon :class="['header-notice-icon']" type="bell" />
27
+ </a-badge>
28
+ </span>
29
+ </a-dropdown>
30
+ </template>
31
+
32
+ <script>
33
+ import { post } from '@vue2-client/services/api'
34
+ export default {
35
+ name: 'HeaderNotice',
36
+ data () {
37
+ return {
38
+ loading: false,
39
+ show: false,
40
+ exception: []
41
+ }
42
+ },
43
+ computed: {
44
+ },
45
+ created () {
46
+ },
47
+ methods: {
48
+ read (item) {
49
+ post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
50
+ this.refresh()
51
+ })
52
+ },
53
+ refresh () {
54
+ post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
55
+ this.exception = res.data
56
+ })
57
+ },
58
+ fetchNotice () {
59
+ if (this.loading) {
60
+ this.loading = false
61
+ return
62
+ }
63
+ this.loadding = true
64
+ setTimeout(() => {
65
+ this.loadding = false
66
+ }, 1000)
67
+ }
68
+ }
69
+ }
70
+ </script>
71
+
72
+ <style lang="less">
73
+ .header-notice{
74
+ display: inline-block;
75
+ transition: all 0.3s;
76
+ span {
77
+ vertical-align: initial;
78
+ }
79
+ .notice-badge{
80
+ color: inherit;
81
+ .header-notice-icon{
82
+ font-size: 16px;
83
+ padding: 4px;
84
+ }
85
+ }
86
+ }
87
+ .dropdown-tabs{
88
+ background-color: @base-bg-color;
89
+ box-shadow: 0 2px 8px @shadow-color;
90
+ border-radius: 4px;
91
+ .tab-pane{
92
+ padding: 0 24px 12px;
93
+ min-height: 250px;
94
+ }
95
+ }
96
+ </style>
@@ -1,26 +1,26 @@
1
- import routerMap from './router.map'
2
- import { parseRoutes } from '@vue2-client/utils/routerUtil'
3
-
4
- // 异步路由配置
5
- const routesConfig = [
6
- 'login',
7
- 'submitTicket',
8
- 'root',
9
- {
10
- router: 'exp404',
11
- path: '*',
12
- name: '404'
13
- },
14
- {
15
- router: 'exp403',
16
- path: '/403',
17
- name: '403'
18
- }
19
- ]
20
-
21
- const options = {
22
- mode: 'history',
23
- routes: parseRoutes(routesConfig, routerMap)
24
- }
25
-
26
- export default options
1
+ import routerMap from './router.map'
2
+ import { parseRoutes } from '@vue2-client/utils/routerUtil'
3
+
4
+ // 异步路由配置
5
+ const routesConfig = [
6
+ 'login',
7
+ 'submitTicket',
8
+ 'root',
9
+ {
10
+ router: 'exp404',
11
+ path: '*',
12
+ name: '404'
13
+ },
14
+ {
15
+ router: 'exp403',
16
+ path: '/403',
17
+ name: '403'
18
+ }
19
+ ]
20
+
21
+ const options = {
22
+ mode: 'history',
23
+ routes: parseRoutes(routesConfig, routerMap)
24
+ }
25
+
26
+ export default options
@@ -1,27 +1,27 @@
1
- import { formatRoutes } from '@vue2-client/utils/routerUtil'
2
-
3
- // 不需要登录拦截的路由配置
4
- const loginIgnore = {
5
- names: ['404', '403'], // 根据路由名称匹配
6
- paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
7
- /**
8
- * 判断路由是否包含在该配置中
9
- * @param route vue-router 的 route 对象
10
- * @returns {boolean}
11
- */
12
- includes (route) {
13
- return this.names.includes(route.name) || this.paths.includes(route.path)
14
- }
15
- }
16
-
17
- /**
18
- * 初始化路由实例
19
- * @param isAsync 是否异步路由模式
20
- * @returns {RouterOptions}
21
- */
22
- function initRouter (isAsync) {
23
- const options = require('./async/config.async').default
24
- formatRoutes(options.routes)
25
- return options
26
- }
27
- export { loginIgnore, initRouter }
1
+ import { formatRoutes } from '@vue2-client/utils/routerUtil'
2
+
3
+ // 不需要登录拦截的路由配置
4
+ const loginIgnore = {
5
+ names: ['404', '403'], // 根据路由名称匹配
6
+ paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
7
+ /**
8
+ * 判断路由是否包含在该配置中
9
+ * @param route vue-router 的 route 对象
10
+ * @returns {boolean}
11
+ */
12
+ includes (route) {
13
+ return this.names.includes(route.name) || this.paths.includes(route.path)
14
+ }
15
+ }
16
+
17
+ /**
18
+ * 初始化路由实例
19
+ * @param isAsync 是否异步路由模式
20
+ * @returns {RouterOptions}
21
+ */
22
+ function initRouter (isAsync) {
23
+ const options = require('./async/config.async').default
24
+ formatRoutes(options.routes)
25
+ return options
26
+ }
27
+ export { loginIgnore, initRouter }
@@ -1,47 +1,47 @@
1
- .week-mode{
2
- overflow: hidden;
3
- filter: invert(80%);
4
- }
5
- .beauty-scroll{
6
- scrollbar-color: @primary-color @primary-2;
7
- scrollbar-width: thin;
8
- -ms-overflow-style:none;
9
- position: relative;
10
- &::-webkit-scrollbar{
11
- width: 3px;
12
- height: 1px;
13
- }
14
- &::-webkit-scrollbar-thumb {
15
- border-radius: 3px;
16
- background: @primary-color;
17
- }
18
- &::-webkit-scrollbar-track {
19
- -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
20
- border-radius: 3px;
21
- background: @primary-3;
22
- }
23
- }
24
- .split-right{
25
- &:not(:last-child) {
26
- border-right: 1px solid rgba(98, 98, 98, 0.2);
27
- }
28
- }
29
- .disabled{
30
- cursor: not-allowed;
31
- color: @disabled-color;
32
- pointer-events: none;
33
- }
34
-
35
- ::-webkit-scrollbar{
36
- width: 5px;
37
- height: 5px;
38
- }
39
- ::-webkit-scrollbar-thumb {
40
- border-radius: 3px;
41
- background: @primary-3;
42
- }
43
- ::-webkit-scrollbar-track {
44
- -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
45
- border-radius: 3px;
46
- background: @primary-1;
47
- }
1
+ .week-mode{
2
+ overflow: hidden;
3
+ filter: invert(80%);
4
+ }
5
+ .beauty-scroll{
6
+ scrollbar-color: @primary-color @primary-2;
7
+ scrollbar-width: thin;
8
+ -ms-overflow-style:none;
9
+ position: relative;
10
+ &::-webkit-scrollbar{
11
+ width: 3px;
12
+ height: 1px;
13
+ }
14
+ &::-webkit-scrollbar-thumb {
15
+ border-radius: 3px;
16
+ background: @primary-color;
17
+ }
18
+ &::-webkit-scrollbar-track {
19
+ -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
20
+ border-radius: 3px;
21
+ background: @primary-3;
22
+ }
23
+ }
24
+ .split-right{
25
+ &:not(:last-child) {
26
+ border-right: 1px solid rgba(98, 98, 98, 0.2);
27
+ }
28
+ }
29
+ .disabled{
30
+ cursor: not-allowed;
31
+ color: @disabled-color;
32
+ pointer-events: none;
33
+ }
34
+
35
+ ::-webkit-scrollbar{
36
+ width: 5px;
37
+ height: 5px;
38
+ }
39
+ ::-webkit-scrollbar-thumb {
40
+ border-radius: 3px;
41
+ background: @primary-3;
42
+ }
43
+ ::-webkit-scrollbar-track {
44
+ -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
45
+ border-radius: 3px;
46
+ background: @primary-1;
47
+ }
@@ -1,17 +1,17 @@
1
- //地图相关插件
2
-
3
- // vuecomp:传入vue组件实例即可
4
- export function getLocation(vuecomp,address) {
5
- return new Promise((resolve,reject)=>{
6
- new vuecomp.$AMap.Geocoder({
7
- radius: 500 //范围,默认:500
8
- }).getLocation(address, function(status, result) {
9
- console.log(result)
10
- if (status === 'complete'&&result.geocodes.length) {
11
- resolve({lng:result.geocodes[0].location.lng,lat:result.geocodes[0].location.lat})
12
- }else{
13
- reject('根据经纬度查询地址失败')
14
- }
15
- })
16
- })
17
- }
1
+ //地图相关插件
2
+
3
+ // vuecomp:传入vue组件实例即可
4
+ export function getLocation(vuecomp,address) {
5
+ return new Promise((resolve,reject)=>{
6
+ new vuecomp.$AMap.Geocoder({
7
+ radius: 500 //范围,默认:500
8
+ }).getLocation(address, function(status, result) {
9
+ console.log(result)
10
+ if (status === 'complete'&&result.geocodes.length) {
11
+ resolve({lng:result.geocodes[0].location.lng,lat:result.geocodes[0].location.lat})
12
+ }else{
13
+ reject('根据经纬度查询地址失败')
14
+ }
15
+ })
16
+ })
17
+ }