vue2-client 1.2.49 → 1.2.50

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 (48) hide show
  1. package/CHANGELOG.md +130 -130
  2. package/package.json +1 -1
  3. package/src/base-client/all.js +61 -61
  4. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +105 -104
  5. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  6. package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
  7. package/src/base-client/components/common/ScrollList/index.js +3 -3
  8. package/src/base-client/components/common/XAddForm/XAddForm.vue +339 -339
  9. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +316 -316
  10. package/src/base-client/components/common/XForm/XFormItem.vue +6 -1
  11. package/src/base-client/components/common/XFormTable/XFormTable.vue +0 -2
  12. package/src/base-client/components/iot/CustomerDetailsView/index.md +1 -2
  13. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +1 -1
  14. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +2 -7
  15. package/src/base-client/components/iot/DeviceDetailsView/index.md +0 -2
  16. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  17. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +240 -196
  18. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  19. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +1 -5
  20. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +6 -14
  21. package/src/base-client/components/iot/InstructDetailsView/index.md +0 -2
  22. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +6 -13
  23. package/src/base-client/components/iot/LogDetailsView/index.md +0 -2
  24. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +17 -24
  25. package/src/base-client/components/iot/MeterDetailsView/index.md +0 -2
  26. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +0 -5
  27. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +0 -5
  28. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +0 -6
  29. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +0 -6
  30. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +1 -6
  31. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +1 -6
  32. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +8 -83
  33. package/src/base-client/components/iot/WebmeterAnalysisView/index.md +0 -6
  34. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +853 -853
  35. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  36. package/src/base-client/plugins/AppData.js +57 -57
  37. package/src/base-client/plugins/compatible/LoginServiceOA.js +19 -0
  38. package/src/config/default/setting.config.js +2 -2
  39. package/src/layouts/header/HeaderNotice.vue +96 -96
  40. package/src/layouts/tabs/TabsView.vue +0 -3
  41. package/src/pages/login/Login.vue +53 -22
  42. package/src/pages/system/ticket/submitTicketSuccess.vue +268 -268
  43. package/src/router/async/config.async.js +26 -26
  44. package/src/router/index.js +27 -27
  45. package/src/theme/default/style.less +47 -47
  46. package/src/utils/map-utils.js +28 -17
  47. package/src/utils/routerUtil.js +1 -10
  48. package/vue.config.js +143 -143
@@ -1,57 +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
- 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
+ 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
@@ -0,0 +1,19 @@
1
+ import { get } from '@vue2-client/services/api'
2
+ import Vue from 'vue'
3
+
4
+ async function loginStart (name, password) {
5
+ const resource = await get(`/rs/user/${name}/${password}/newoa`, {})
6
+ console.log('登陆获取', resource)
7
+ Vue.$login.f = resource
8
+ const login = {
9
+ f: Vue.$login.f,
10
+ jwt: Vue.$login.f.id,
11
+ r: Vue.$login.r
12
+ }
13
+ Vue.$store.commit('account/setLogin', login)
14
+ return resource
15
+ }
16
+
17
+ export {
18
+ loginStart
19
+ }
@@ -34,6 +34,6 @@ module.exports = {
34
34
  ],
35
35
  // 旧系统路径
36
36
  iframeSrc: '../singlepage/page.html',
37
- // 兼容V2版本系统 true:启用, false:禁用
38
- compatibleV2: false
37
+ // 兼容旧版本 V3(最新V3产品) OA(公司OA)
38
+ compatible: 'V3'
39
39
  }
@@ -1,96 +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
- },
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
+ <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>
@@ -367,9 +367,6 @@ export default {
367
367
  width: 1400px;
368
368
  margin: 0 auto;
369
369
  }
370
- .ant-card:only-of-type {
371
- min-height: calc(100vh - 64px - 56px - 16px);
372
- }
373
370
  }
374
371
  }
375
372
  </style>
@@ -60,9 +60,9 @@ import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
60
60
  import { mapMutations, mapState } from 'vuex'
61
61
  import JSEncrypt from 'jsencrypt'
62
62
  import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
63
- import Vue from 'vue'
64
63
  import { positions } from '@vue2-client/mock/common'
65
64
  import { timeFix } from '@vue2-client/utils/util'
65
+ import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
66
 
67
67
  export default {
68
68
  name: 'Login',
@@ -75,7 +75,7 @@ export default {
75
75
  }
76
76
  },
77
77
  computed: {
78
- ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage'])
78
+ ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible'])
79
79
  },
80
80
  methods: {
81
81
  ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
@@ -86,10 +86,27 @@ export default {
86
86
  this.logging = true
87
87
  const name = this.form.getFieldValue('name')
88
88
  const password = this.form.getFieldValue('password')
89
- login(name, password).then(this.afterLogin)
89
+ switch (this.compatible) {
90
+ case 'V3': {
91
+ login(name, password).then(this.afterLogin)
92
+ break
93
+ }
94
+ case 'OA' : {
95
+ loginStart(name, password).then(this.afterLoginOA).finally(() => { this.logging = false })
96
+ break
97
+ }
98
+ }
90
99
  }
91
100
  })
92
101
  },
102
+ afterLoginOA (result) {
103
+ // 默认第一个是旧OA地址
104
+ result.functions[0].navigate = result.functions[0].link
105
+ result.functions[0].link = null
106
+ this.afterGeneral(result)
107
+ this.setACCESSTOKEN(result.password)
108
+ this.$router.push(this.homePage).catch(() => {})
109
+ },
93
110
  afterLogin (res) {
94
111
  const name = this.form.getFieldValue('name')
95
112
  const password = this.form.getFieldValue('password')
@@ -99,37 +116,51 @@ export default {
99
116
  const encrypt = new JSEncrypt()
100
117
  encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
101
118
  const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
102
- localStorage.setItem(ACCESS_TOKEN, data)
103
119
  // 获取路由配置
104
120
  getRoutesConfig(data).then(result => {
105
- Vue.$login.login(result).then(() => {
106
- const user = Object.assign({
107
- username: result.ename,
108
- name: result.name,
109
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
110
- address: '西安市',
111
- position: positions[0]
112
- }, result)
113
- this.setUser(user)
114
- this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
115
- this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
116
- let timestamp = new Date().getTime()// 当前的时间戳
117
- timestamp = timestamp + 60 * 60 * 1000
118
- // 格式化时间获取年月日, 登陆过期时间
119
- const dateAfter = new Date(timestamp)
120
- setAuthorization({ token: data, expireAt: dateAfter })
121
- loadRoutes(funcToRouter(user.functions))
121
+ this.$login.login(result).then(() => {
122
+ // V3任何情况首位加入资源管理
123
+ const resourceManageMain = {
124
+ name: '资源管理',
125
+ icon: 'api',
126
+ position: 1,
127
+ link: 'resourceManageMain'
128
+ }
129
+ result.functions.unshift(resourceManageMain)
130
+ this.afterGeneral(result)
131
+ this.setACCESSTOKEN(data)
122
132
  if (result.deps === '用户工单登记') {
123
133
  this.$router.push(this.ticketPage).catch(() => {})
124
134
  } else {
125
135
  this.$router.push(this.homePage).catch(() => {})
126
136
  }
127
- this.$message.success(timeFix().CN + ',欢迎回来', 3)
128
137
  })
129
138
  })
130
139
  } else {
131
140
  this.error = loginRes
132
141
  }
142
+ },
143
+ afterGeneral (result) {
144
+ const user = Object.assign({
145
+ username: result.ename,
146
+ name: result.name,
147
+ avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
148
+ address: '西安市',
149
+ position: positions[0]
150
+ }, result)
151
+ this.setUser(user)
152
+ this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
153
+ this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
154
+ loadRoutes(funcToRouter(user.functions))
155
+ this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
156
+ },
157
+ setACCESSTOKEN (data) {
158
+ localStorage.setItem(ACCESS_TOKEN, data)
159
+ let timestamp = new Date().getTime()// 当前的时间戳
160
+ timestamp = timestamp + 60 * 60 * 1000
161
+ // 格式化时间获取年月日, 登陆过期时间
162
+ const dateAfter = new Date(timestamp)
163
+ setAuthorization({ token: data, expireAt: dateAfter })
133
164
  }
134
165
  }
135
166
  }