vue2-client 1.7.8 → 1.7.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.7.8",
3
+ "version": "1.7.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
@@ -147,14 +147,6 @@ export default {
147
147
  },
148
148
  deep: true
149
149
  },
150
- fixedQueryForm: {
151
- handler () {
152
- this.$nextTick(() => {
153
- this.refreshTable(true)
154
- })
155
- },
156
- deep: true
157
- },
158
150
  queryParamsJson: {
159
151
  handler () {
160
152
  this.getConfigBySource()
@@ -343,6 +335,15 @@ export default {
343
335
  refreshTable (toFirstPage = true) {
344
336
  this.$refs.xTable.refresh(toFirstPage)
345
337
  },
338
+ /**
339
+ * 设置固定查询表单
340
+ */
341
+ setFixedQueryForm (form, isRefreshTable) {
342
+ this.fixedQueryForm = form
343
+ if (isRefreshTable) {
344
+ this.refreshTable(true)
345
+ }
346
+ }
346
347
  }
347
348
  }
348
349
  </script>
@@ -129,7 +129,9 @@ export default {
129
129
  // 取到表格携带的表单参数
130
130
  const requestParameters = Object.assign({}, parameter)
131
131
  // 取到父组件传入的表单参数
132
- const conditionParams = Object.assign(this.form, this.fixedQueryForm)
132
+ const conditionParams = {}
133
+ Object.assign(conditionParams, this.fixedQueryForm)
134
+ Object.assign(conditionParams, this.form)
133
135
  // 如果传了燃气公司字段,则进行数据处理
134
136
  if (conditionParams.orgName) {
135
137
  requestParameters.orgName = conditionParams.orgName
@@ -1,5 +1,6 @@
1
1
  import { manageApi, post } from '@vue2-client/services/api'
2
2
  import { handleTree } from '@vue2-client/utils/util'
3
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
3
4
 
4
5
  const GetAppDataService = {
5
6
  install (Vue) {
@@ -34,20 +35,18 @@ const GetAppDataService = {
34
35
  },
35
36
  // 返回树形省市区
36
37
  async getDivisionsOhChinaForTree () {
37
- let list = this.getDivisionsOhChinaForList()
38
38
  // 获取省市区数据
39
- if (!list) {
40
- await post(manageApi.getDivisionsOhChina, {}).then((res) => {
41
- list = res
42
- // localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
43
- })
44
- }
45
- return handleTree(list, 'code', 'parentcode')
46
- },
47
- // 返回列表省市区
48
- getDivisionsOhChinaForList () {
49
- const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
50
- return JSON.parse(str)
39
+ return new Promise((resolve, reject) => {
40
+ try {
41
+ indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, res => {
42
+ resolve(res)
43
+ }, processRes => {
44
+ return handleTree(processRes, 'code', 'parentcode')
45
+ })
46
+ } catch (e) {
47
+ reject(e)
48
+ }
49
+ })
51
50
  },
52
51
  getDictionaryList (key) {
53
52
  const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
@@ -92,7 +92,7 @@ export const indexedDB = {
92
92
  }
93
93
  })
94
94
  },
95
- getByWeb: function (key, url, params, callback) {
95
+ getByWeb: function (key, url, params, callback, process) {
96
96
  const self = this
97
97
  self.openDB((res) => {
98
98
  // 根据存储空间的键找到对应数据
@@ -105,6 +105,9 @@ export const indexedDB = {
105
105
  const result = e.target.result
106
106
  if (!result && url) {
107
107
  post(url, params).then((res) => {
108
+ if (process) {
109
+ res = process(res)
110
+ }
108
111
  self.add(key, res)
109
112
  callback(res)
110
113
  })
package/vue.config.js CHANGED
@@ -30,7 +30,7 @@ module.exports = {
30
30
  changeOrigin: true
31
31
  },
32
32
  '/api': {
33
- pathRewrite: { '^/api/af-system/': '/rs/' },
33
+ pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
34
34
  // pathRewrite: { '^/api': '/' },
35
35
  target: local,
36
36
  changeOrigin: true