vue2-client 1.8.64 → 1.8.66

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,12 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.66 -2024-3-5 @江超**
5
+ - 完善`XTable`在开发环境下的查询效果
6
+
7
+ **1.8.65 -2024-3-5 @张振宇**
8
+ - fix `XTree` 组件 控制台报错
9
+
4
10
  **1.8.63 - 1.8.64 -2024-3-4 @江超**
5
11
  - 新增`XTree`组件
6
12
  - 全局设置字体为`PingFangSC-Regular`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.64",
3
+ "version": "1.8.66",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -142,6 +142,13 @@ export default {
142
142
  return false
143
143
  }
144
144
  },
145
+ // 环境
146
+ env: {
147
+ type: String,
148
+ default: () => {
149
+ return 'prod'
150
+ }
151
+ },
145
152
  // 数据只有一页时是否展示分页,true:展示,auto:隐藏
146
153
  showPagination: {
147
154
  type: Boolean,
@@ -220,7 +227,8 @@ export default {
220
227
  title: this.title,
221
228
  viewMode: this.viewMode,
222
229
  isTableTemp: this.isTableTemp,
223
- serviceName: this.serviceName
230
+ serviceName: this.serviceName,
231
+ env: this.env
224
232
  })
225
233
  this.$refs.xForm.init({
226
234
  formItems: res.formJson,
@@ -183,7 +183,9 @@ export default {
183
183
  iconStyle: {
184
184
  position: 'relative',
185
185
  top: '1px'
186
- }
186
+ },
187
+ // 当前环境
188
+ env: 'prod'
187
189
  }
188
190
  },
189
191
  props: {
@@ -234,7 +236,8 @@ export default {
234
236
  buttonState,
235
237
  title,
236
238
  serviceName,
237
- viewMode
239
+ viewMode,
240
+ env = 'prod'
238
241
  } = params
239
242
  this.queryParams = queryParams
240
243
  this.tableColumns = JSON.parse(JSON.stringify(tableColumns))
@@ -245,6 +248,7 @@ export default {
245
248
  this.title = title
246
249
  this.serviceName = serviceName
247
250
  this.viewMode = viewMode
251
+ this.env = env
248
252
  this.rowKey = this.tableColumns[0].dataIndex
249
253
  let totalWidth = 0
250
254
  // 设置表格宽度
@@ -372,8 +376,8 @@ export default {
372
376
  exportData({
373
377
  queryParamsName: that.queryParamsName,
374
378
  queryParams: that.queryParams,
375
- form: conditionParams
376
- }, that.serviceName).then(res => {
379
+ form: conditionParams,
380
+ }, that.serviceName, this.env === 'dev').then(res => {
377
381
  let value = res
378
382
  if (that.compatible === 'V4') {
379
383
  value = res.value
@@ -418,7 +422,7 @@ export default {
418
422
  this.$emit('tempTableEdit', requestParameters)
419
423
  return
420
424
  }
421
- return queryWithResource(requestParameters, this.serviceName).then(res => {
425
+ return queryWithResource(requestParameters, this.serviceName, this.env === 'dev').then(res => {
422
426
  // 将更新需要的主键值加入到primaryKeyData中
423
427
  const primaryKeyData = {}
424
428
  primaryKeyData[primaryKeyName] = this.selectId
@@ -441,7 +445,7 @@ export default {
441
445
  queryParamsName: this.queryParamsName,
442
446
  idList: this.selectedRowKeys
443
447
  }
444
- remove(requestParameters, this.serviceName).then(res => {
448
+ remove(requestParameters, this.serviceName, this.env === 'dev').then(res => {
445
449
  resolve(res)
446
450
  this.$message.success('删除成功!')
447
451
  this.refresh(true)
@@ -1,71 +1,71 @@
1
- <script setup>
2
- const props = defineProps({
3
- // 树数据
4
- // example: [{ title: '标题', key: '1', children: []}]
5
- treeData: {
6
- type: Array,
7
- required: true
8
- }
9
- })
10
-
11
- const emit = defineEmits(['onSelect'])
12
-
13
- function onSelect (keys, e) {
14
- emit('onSelect', keys, e)
15
- }
16
- </script>
17
-
18
- <template>
19
- <div class="tree_main">
20
- <a-directory-tree
21
- :tree-data="props.treeData"
22
- @select="onSelect"
23
- :default-selected-keys="props.treeData.length > 0 ? props.treeData[0].key : null"
24
- :default-expand-all="true"
25
- ></a-directory-tree>
26
- </div>
27
- </template>
28
-
29
- <style lang="less" scoped>
30
- .tree_main {
31
- :deep(.ant-tree li .ant-tree-node-content-wrapper){
32
- color: #000000e0;
33
- }
34
- :deep(.ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle) {
35
- color: #0000004d;
36
- i {
37
- font-size: 16px !important;
38
- line-height: 40px;
39
- }
40
- }
41
- :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper::before, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper::before){
42
- height: 40px;
43
- border-radius: 6px;
44
- }
45
- :deep(.ant-tree.ant-tree-directory > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
46
- background: #e6f7ff;
47
- }
48
- :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
49
- background: #e6f7ff;
50
- }
51
- :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-switcher){
52
- color: #0000004d;
53
- }
54
- :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper.ant-tree-node-selected, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper.ant-tree-node-selected){
55
- color: #000000e0;
56
- }
57
- :deep(.ant-tree li .ant-tree-node-content-wrapper){
58
- line-height: 40px;
59
- height: 40px;
60
- }
61
- :deep(.ant-tree li) {
62
- padding-left: 4px;
63
- }
64
- :deep(.ant-tree ul) {
65
- padding-left: 10px;
66
- }
67
- :deep(.ant-tree-icon__customize){
68
- display: none;
69
- }
70
- }
71
- </style>
1
+ <script setup>
2
+ const props = defineProps({
3
+ // 树数据
4
+ // example: [{ title: '标题', key: '1', children: []}]
5
+ treeData: {
6
+ type: Array,
7
+ required: true
8
+ }
9
+ })
10
+
11
+ const emit = defineEmits(['onSelect'])
12
+
13
+ function onSelect (keys, e) {
14
+ emit('onSelect', keys, e)
15
+ }
16
+ </script>
17
+
18
+ <template>
19
+ <div class="tree_main">
20
+ <a-directory-tree
21
+ :tree-data="props.treeData"
22
+ @select="onSelect"
23
+ :default-selected-keys="props.treeData.length > 0 ? [props.treeData[0].key] : null"
24
+ :default-expand-all="true"
25
+ ></a-directory-tree>
26
+ </div>
27
+ </template>
28
+
29
+ <style lang="less" scoped>
30
+ .tree_main {
31
+ :deep(.ant-tree li .ant-tree-node-content-wrapper){
32
+ color: #000000e0;
33
+ }
34
+ :deep(.ant-tree li span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle) {
35
+ color: #0000004d;
36
+ i {
37
+ font-size: 16px !important;
38
+ line-height: 40px;
39
+ }
40
+ }
41
+ :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper::before, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper::before){
42
+ height: 40px;
43
+ border-radius: 6px;
44
+ }
45
+ :deep(.ant-tree.ant-tree-directory > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
46
+ background: #e6f7ff;
47
+ }
48
+ :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-node-content-wrapper::before){
49
+ background: #e6f7ff;
50
+ }
51
+ :deep(.ant-tree.ant-tree-directory .ant-tree-child-tree > li.ant-tree-treenode-selected > span.ant-tree-switcher){
52
+ color: #0000004d;
53
+ }
54
+ :deep(.ant-tree.ant-tree-directory > li span.ant-tree-node-content-wrapper.ant-tree-node-selected, .ant-tree.ant-tree-directory .ant-tree-child-tree > li span.ant-tree-node-content-wrapper.ant-tree-node-selected){
55
+ color: #000000e0;
56
+ }
57
+ :deep(.ant-tree li .ant-tree-node-content-wrapper){
58
+ line-height: 40px;
59
+ height: 40px;
60
+ }
61
+ :deep(.ant-tree li) {
62
+ padding-left: 4px;
63
+ }
64
+ :deep(.ant-tree ul) {
65
+ padding-left: 10px;
66
+ }
67
+ :deep(.ant-tree-icon__customize){
68
+ display: none;
69
+ }
70
+ }
71
+ </style>
@@ -109,68 +109,108 @@ export function parseConfig (configContent, configType, serviceName = process.en
109
109
  /**
110
110
  * 通用执行业务逻辑
111
111
  */
112
- export function runLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
113
- return post('/api/' + serviceName + '/logic/' + logicName, parameter)
112
+ export function runLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
113
+ let apiPre = '/api/'
114
+ if (isDev) {
115
+ apiPre = '/devApi/'
116
+ }
117
+ return post(apiPre + serviceName + '/logic/' + logicName, parameter)
114
118
  }
115
119
 
116
120
  /**
117
121
  * 通用查询
118
122
  */
119
- export function query (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
120
- return post('/api/' + serviceName + '/' + commonApi.query, parameter, null)
123
+ export function query (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
124
+ let apiPre = '/api/'
125
+ if (isDev) {
126
+ apiPre = '/devApi/'
127
+ }
128
+ return post(apiPre + serviceName + '/' + commonApi.query, parameter, null)
121
129
  }
122
130
 
123
131
  /**
124
132
  * 通用表单查询
125
133
  */
126
- export function queryWithResource (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
127
- return post('/api/' + serviceName + '/' + commonApi.queryWithResource, parameter, null)
134
+ export function queryWithResource (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
135
+ let apiPre = '/api/'
136
+ if (isDev) {
137
+ apiPre = '/devApi/'
138
+ }
139
+ return post(apiPre + serviceName + '/' + commonApi.queryWithResource, parameter, null)
128
140
  }
129
141
 
130
142
  /**
131
143
  * 通用新增/修改
132
144
  */
133
- export function addOrModify (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
134
- return post('/api/' + serviceName + '/' + commonApi.addOrModify, parameter, null)
145
+ export function addOrModify (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
146
+ let apiPre = '/api/'
147
+ if (isDev) {
148
+ apiPre = '/devApi/'
149
+ }
150
+ return post(apiPre + serviceName + '/' + commonApi.addOrModify, parameter, null)
135
151
  }
136
152
 
137
153
  /**
138
154
  * 通用删除
139
155
  */
140
- export function remove (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
141
- return post('/api/' + serviceName + '/' + commonApi.delete, parameter, null)
156
+ export function remove (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
157
+ let apiPre = '/api/'
158
+ if (isDev) {
159
+ apiPre = '/devApi/'
160
+ }
161
+ return post(apiPre + serviceName + '/' + commonApi.delete, parameter, null)
142
162
  }
143
163
 
144
164
  /**
145
165
  * 通用导入
146
166
  */
147
- export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
148
- return post('/api/' + serviceName + '/' + commonApi.importData, parameter, null)
167
+ export function importData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
168
+ let apiPre = '/api/'
169
+ if (isDev) {
170
+ apiPre = '/devApi/'
171
+ }
172
+ return post(apiPre + serviceName + '/' + commonApi.importData, parameter, null)
149
173
  }
150
174
 
151
175
  /**
152
176
  * 通用导出
153
177
  */
154
- export function exportData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
155
- return post('/api/' + serviceName + '/' + commonApi.exportData, parameter, null)
178
+ export function exportData (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
179
+ let apiPre = '/api/'
180
+ if (isDev) {
181
+ apiPre = '/devApi/'
182
+ }
183
+ return post(apiPre + serviceName + '/' + commonApi.exportData, parameter, null)
156
184
  }
157
185
 
158
186
  /**
159
187
  * 通用上传
160
188
  */
161
- export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, config) {
162
- return post('/api/' + serviceName + '/' + commonApi.upload, parameter, config)
189
+ export function upload (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, config, isDev) {
190
+ let apiPre = '/api/'
191
+ if (isDev) {
192
+ apiPre = '/devApi/'
193
+ }
194
+ return post(apiPre + serviceName + '/' + commonApi.upload, parameter, config)
163
195
  }
164
196
 
165
197
  /**
166
198
  * 通用导入模板下载
167
199
  */
168
- export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
169
- return post('/api/' + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
200
+ export function downloadImportExcel (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
201
+ let apiPre = '/api/'
202
+ if (isDev) {
203
+ apiPre = '/devApi/'
204
+ }
205
+ return post(apiPre + serviceName + '/' + commonApi.downloadImportTemplate, parameter, null)
170
206
  }
171
207
 
172
208
  // 通用下载
173
- export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
209
+ export function download (parameter, filename, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
210
+ let apiPre = '/api/'
211
+ if (isDev) {
212
+ apiPre = '/devApi/'
213
+ }
174
214
  const notificationKey = 'download'
175
215
  notification.open({
176
216
  key: notificationKey,
@@ -187,7 +227,7 @@ export function download (parameter, filename, serviceName = process.env.VUE_APP
187
227
  )
188
228
  }
189
229
  })
190
- return post('/api/' + serviceName + '/' + commonApi.download, parameter, {
230
+ return post(apiPre + serviceName + '/' + commonApi.download, parameter, {
191
231
  responseType: 'blob'
192
232
  }).then(async (data) => {
193
233
  const isLogin = await blobValidate(data)
@@ -210,8 +250,12 @@ export function download (parameter, filename, serviceName = process.env.VUE_APP
210
250
  }
211
251
 
212
252
  // 文件删除
213
- export function fileDelete (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
214
- return post('/api/' + serviceName + '/' + commonApi.fileEntity, parameter)
253
+ export function fileDelete (parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
254
+ let apiPre = '/api/'
255
+ if (isDev) {
256
+ apiPre = '/devApi/'
257
+ }
258
+ return post(apiPre + serviceName + '/' + commonApi.fileEntity, parameter)
215
259
  }
216
260
 
217
261
  export { commonApi }