vue2-client 1.7.12 → 1.7.14

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/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.7.14 -2023-10-10 @江超**
5
+ - webConfig在开发环境下不存储到indexedDB中
6
+
7
+ **1.7.2 - 1.7.13 -2023-10-09 @江超**
8
+ - 完成前端整体配置接入配置中心
9
+ - 完成组件规范化
10
+
4
11
  **1.7.1 -2023-08-23 @江超**
5
12
  - 合并单页面修改
6
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.7.12",
3
+ "version": "1.7.14",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
@@ -2,46 +2,53 @@
2
2
  <div>
3
3
  <a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
4
4
  <div v-show="!loading">
5
- <x-add-form
6
- ref="xAddForm"
7
- @onSubmit="onAddOrEditSubmit"
8
- />
9
- <x-form
10
- ref="xForm"
11
- style="margin-bottom: 14px;"
12
- @onSubmit="onSearchSubmit">
13
- <slot name="formBtnExpand"></slot>
14
- </x-form>
15
- <x-table
16
- ref="xTable"
17
- :fixedQueryForm="fixedQueryForm"
18
- :queryParamsName="queryParamsName"
19
- :query-params-json="queryParamsJson"
20
- :show-pagination="showPagination"
21
- @add="add"
22
- @edit="edit"
23
- @afterDelete="afterDelete"
24
- @action="action"
25
- @selectRow="selectRow"
26
- @afterQuery="afterQuery"
27
- @tempTableEdit="tempTableEdit">
28
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
29
- <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
30
- </template>
31
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
32
- <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
33
- </template>
34
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
35
- <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
36
- <a-button @click="toggleIsFormShow">
37
- <a-icon :style="iconStyle" type="vertical-align-top"/>
38
- </a-button>
39
- </template>
40
- <!-- 底部插槽 -->
41
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
42
- <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
43
- </template>
44
- </x-table>
5
+ <template v-if="!loadError">
6
+ <x-add-form
7
+ ref="xAddForm"
8
+ @onSubmit="onAddOrEditSubmit"
9
+ />
10
+ <x-form
11
+ ref="xForm"
12
+ style="margin-bottom: 14px;"
13
+ @onSubmit="onSearchSubmit">
14
+ <slot name="formBtnExpand"></slot>
15
+ </x-form>
16
+ <x-table
17
+ ref="xTable"
18
+ :fixedQueryForm="fixedQueryForm"
19
+ :queryParamsName="queryParamsName"
20
+ :query-params-json="queryParamsJson"
21
+ :show-pagination="showPagination"
22
+ @add="add"
23
+ @edit="edit"
24
+ @afterDelete="afterDelete"
25
+ @action="action"
26
+ @selectRow="selectRow"
27
+ @afterQuery="afterQuery"
28
+ @tempTableEdit="tempTableEdit">
29
+ <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
30
+ <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
31
+ </template>
32
+ <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
33
+ <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
34
+ </template>
35
+ <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
36
+ <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
37
+ <a-button @click="toggleIsFormShow">
38
+ <a-icon :style="iconStyle" type="vertical-align-top"/>
39
+ </a-button>
40
+ </template>
41
+ <!-- 底部插槽 -->
42
+ <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
43
+ <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
44
+ </template>
45
+ </x-table>
46
+ </template>
47
+ <template v-else>
48
+ <a-empty>
49
+ <span slot="description"> 页面配置不存在,请联系系统管理员 </span>
50
+ </a-empty>
51
+ </template>
45
52
  </div>
46
53
  </div>
47
54
  </template>
@@ -70,6 +77,7 @@ export default {
70
77
  position: 'relative',
71
78
  top: '1px'
72
79
  },
80
+ loadError: false,
73
81
  // 实际查询配置内容
74
82
  realQueryConfig: {}
75
83
  }
@@ -143,44 +151,51 @@ export default {
143
151
  watch: {
144
152
  logicParam: {
145
153
  handler () {
146
- this.getColumnJsonByLogic()
154
+ this.initConfig()
147
155
  },
148
156
  deep: true
149
157
  },
150
158
  queryParamsJson: {
151
159
  handler () {
152
- this.getConfigBySource()
160
+ this.initConfig()
153
161
  },
154
162
  deep: true
155
163
  },
156
164
  queryParamsName: {
157
165
  handler () {
158
- this.getConfig()
166
+ this.initConfig()
159
167
  }
160
168
  }
161
169
  },
162
170
  created () {
163
- if (this.queryParamsName) {
164
- this.getConfig()
165
- } else if (this.queryParamsJson) {
166
- this.getConfigBySource()
167
- }
171
+ this.initConfig()
168
172
  },
169
173
  methods: {
170
- getConfig () {
174
+ initConfig () {
171
175
  this.loading = true
176
+ this.loadError = false
177
+ if (this.queryParamsName) {
178
+ this.getConfig()
179
+ } else if (this.queryParamsJson) {
180
+ this.getConfigBySource()
181
+ } else if (this.logicName && this.logicParam) {
182
+ this.getColumnJsonByLogic()
183
+ } else {
184
+ this.loading = false
185
+ this.loadError = true
186
+ }
187
+ },
188
+ getConfig () {
172
189
  getConfig(this.queryParamsName, this.serviceName, (res) => {
173
190
  this.updateComponents(res)
174
191
  })
175
192
  },
176
193
  getConfigBySource () {
177
- this.loading = true
178
194
  parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName).then(res => {
179
195
  this.updateComponents(res, true)
180
196
  })
181
197
  },
182
198
  getColumnJsonByLogic () {
183
- this.loading = true
184
199
  getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
185
200
  this.updateComponents(res, true)
186
201
  })
@@ -42,7 +42,7 @@ module.exports = {
42
42
  // 兼容旧版本 V3(最新V3产品) OA(公司OA)
43
43
  compatible: 'V3',
44
44
  // 路由资源名称
45
- routeName: '物联网设备采集',
45
+ routeName: '智慧燃气',
46
46
  // 自定义组件集合 格式为组件名: 组件路径(不需要带@/)
47
47
  customizeComponent: {},
48
48
  // 自定义默认头像路径
@@ -92,7 +92,7 @@ export const indexedDB = {
92
92
  }
93
93
  })
94
94
  },
95
- getByWeb: function (key, url, params, callback, process) {
95
+ getByWeb: function (key, url, params, callback, processFun) {
96
96
  const self = this
97
97
  self.openDB((res) => {
98
98
  // 根据存储空间的键找到对应数据
@@ -105,10 +105,12 @@ 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)
108
+ if (processFun) {
109
+ res = processFun(res)
110
+ }
111
+ if (process.env.NODE_ENV === 'production' || key !== 'webConfig') {
112
+ self.add(key, res)
110
113
  }
111
- self.add(key, res)
112
114
  callback(res)
113
115
  })
114
116
  } else {