vue2-client 1.8.340 → 1.8.341

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/.env CHANGED
@@ -14,6 +14,6 @@ VUE_APP_SINGLEVALUE_KEY=admin.singlevalue
14
14
  VUE_APP_DIVISIONSOHCHINA=admin.divisionsohchina
15
15
  VUE_APP_WEB_CONFIG_KEY=admin.webconfig
16
16
  VUE_APP_API_BASE_URL=http://123.60.214.109:8405
17
- VUE_APP_SYSTEM_NAME=af-system
17
+ VUE_APP_SYSTEM_NAME=af-revenue
18
18
  VUE_APP_LOGIN_VERSION=V4
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.340",
3
+ "version": "1.8.341",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -47,7 +47,7 @@
47
47
  <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
48
48
  <a-tooltip title="汇总" placement="bottom">
49
49
  <a-button @click="showDrawer">
50
- <a-icon :style="iconStyle" type="container"/>
50
+ <a-icon :style="iconStyle" type="project"/>
51
51
  </a-button>
52
52
  </a-tooltip>
53
53
  <a-tooltip title="重新查询" placement="bottom">
@@ -75,6 +75,7 @@
75
75
  :rowSelection="rowSelection"
76
76
  :scroll="{ x: scrollXWidth, y: scrollYHeight }"
77
77
  :showPagination="showPagination"
78
+ :setScrollYHeight="setScrollYHeight"
78
79
  size="default"
79
80
  >
80
81
  <template
@@ -154,7 +155,7 @@
154
155
  :title="f.title + ':'"
155
156
  :value="f.value"
156
157
  :precision="2"
157
- style="margin-right: 50px" />
158
+ style="margin-right: 50px"/>
158
159
  </div>
159
160
  </template>
160
161
  </a-drawer>
@@ -177,7 +178,14 @@ import { formatDate } from '@vue2-client/utils/util'
177
178
  import XBadge from '@vue2-client/base-client/components/common/XBadge'
178
179
  import TableSetting from '@vue2-client/components/TableSetting/TableSetting'
179
180
  import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
180
- import { exportData, query, querySummary, queryWithResource, remove, asyncRunTask } from '@vue2-client/services/api/common'
181
+ import {
182
+ exportData,
183
+ query,
184
+ querySummary,
185
+ queryWithResource,
186
+ remove,
187
+ asyncRunTask
188
+ } from '@vue2-client/services/api/common'
181
189
  import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
182
190
  import { Modal } from 'ant-design-vue'
183
191
  import { post } from '@vue2-client/services/api'
@@ -350,7 +358,6 @@ export default {
350
358
  ...mapState('setting', ['compatible'])
351
359
  },
352
360
  mounted () {
353
- this.setScrollYHeight({}) // 初始化时也调用一次,确保加载时高度正确
354
361
  window.addEventListener('resize', this.handleResize)
355
362
  },
356
363
  beforeDestroy () {
@@ -450,8 +457,6 @@ export default {
450
457
  this.clearRowKeys()
451
458
  }
452
459
  this.$emit('afterQuery', result, requestParameters.conditionParams)
453
- // 设置表格高度为固定值
454
- this.setScrollYHeight({ type: 'default' })
455
460
  return result
456
461
  },
457
462
  /**
@@ -503,18 +508,20 @@ export default {
503
508
  },
504
509
  setScrollYHeight ({ extraHeight = this.extraHeight, id = this.uniqueId, type = '' }) {
505
510
  this.$nextTick(() => {
511
+ const curDocument = window?.rawDocument || document
506
512
  if (typeof extraHeight == 'undefined') {
507
513
  // 默认底部分页32 + 边距48
508
514
  extraHeight = 48 + 32
509
515
  }
510
516
  let tHeader = null
511
517
  if (id) {
512
- tHeader = document.getElementById(id) ? document.getElementById(id).getElementsByClassName('ant-table-thead')[0] : null
518
+ tHeader = curDocument.getElementById(id) ? curDocument.getElementById(id).getElementsByClassName('ant-table-thead')[0] : null
513
519
  } else {
514
- tHeader = document.getElementsByClassName('ant-table-thead')[0]
520
+ tHeader = curDocument.getElementsByClassName('ant-table-thead')[0]
515
521
  }
516
522
  // 表格内容距离顶部的距离
517
523
  let tHeaderBottom = 0
524
+ console.log(tHeader, tHeader.getBoundingClientRect())
518
525
  if (tHeader) {
519
526
  tHeaderBottom = tHeader.getBoundingClientRect().bottom
520
527
  }
@@ -532,12 +539,15 @@ export default {
532
539
  if (tHeader) {
533
540
  modalElement = tHeader.closest('.ant-modal-body')
534
541
  } else {
535
- modalElement = document.querySelector('.ant-modal-body')
542
+ modalElement = curDocument.querySelector('.ant-modal-body')
536
543
  }
544
+ console.log(modalElement)
537
545
  if (modalElement) {
538
546
  const modalRect = modalElement.getBoundingClientRect()
539
547
  // 48 是 modal 通常的边距 32 是分页
540
- extraHeight = window.innerHeight - modalRect.bottom + 32 + 48
548
+ const innerHeight = window?.rawWindow?.innerHeight || window.innerHeight || 0
549
+ console.log(tHeaderBottom, modalRect.bottom)
550
+ extraHeight = innerHeight - modalRect.bottom + 32 + 48
541
551
  }
542
552
  }
543
553
  // 窗体高度-表格内容顶部的高度-表格内容底部的高度
@@ -26,6 +26,10 @@ export default {
26
26
  type: Function,
27
27
  required: true
28
28
  },
29
+ setScrollYHeight: {
30
+ type: Function,
31
+ required: true
32
+ },
29
33
  pageNum: {
30
34
  type: Number,
31
35
  default: 1
@@ -191,8 +195,10 @@ export default {
191
195
  }
192
196
  this.localDataSource = r.data // 返回结果中的数组数据
193
197
  this.localLoading = false
198
+ this.setScrollYHeight({ type: 'default' })
194
199
  }, () => {
195
200
  this.localLoading = false
201
+ this.setScrollYHeight({ type: 'default' })
196
202
  })
197
203
  }
198
204
  },
@@ -332,10 +338,23 @@ export default {
332
338
  <a-col flex="0 0">
333
339
  <a-pagination
334
340
  total={this.localPagination.total}
335
- onChange={(page, pageSize) => this.loadData({
336
- current: page,
337
- pageSize: pageSize
338
- })
341
+ onChange={(page, pageSize) => {
342
+ this.pageSize = pageSize
343
+ this.pageNum = page
344
+ this.loadData({
345
+ current: page,
346
+ pageSize: pageSize
347
+ })
348
+ }
349
+ }
350
+ onShowSizeChange={(page, pageSize) => {
351
+ this.pageSize = pageSize
352
+ this.pageNum = page
353
+ this.loadData({
354
+ current: page,
355
+ pageSize: pageSize
356
+ })
357
+ }
339
358
  }
340
359
  show-total={(total, range) => range[0] === range[1] ? `${range[0]} | 共 ${total} 项` : `${range[0]}-${range[1]} | 共 ${total} 项`}
341
360
  default-current={this.localPagination.current}
@@ -1,81 +1,71 @@
1
1
  <template>
2
- <a-card id="test">
3
- <!-- <XFormTable query-params-name="planMangeV4TestCRUD" service-name="af-safecheck" style="margin-bottom: 5%"/>-->
4
- <!-- 修改 import 路径展示不同的组件 Demo -->
5
- <Demo />
2
+ <a-card :bordered="false">
3
+ <x-form-table
4
+ title="示例表单查询"
5
+ :queryParamsName="queryParamsName"
6
+ :fixedAddForm="fixedAddForm"
7
+ @action="action"
8
+ ref="xFormTable">
9
+ </x-form-table>
10
+ <a-drawer
11
+ title="详情信息"
12
+ placement="right"
13
+ :destroy-on-close="true"
14
+ width="85vw"
15
+ :closable="false"
16
+ :visible="detailVisible"
17
+ @close="onClose">
18
+ <span>
19
+ 详情表单内容
20
+ </span>
21
+ </a-drawer>
6
22
  </a-card>
7
23
  </template>
8
24
 
9
25
  <script>
10
- import Demo from '@vue2-client/base-client/components/common/AddressSearchCombobox/demo.vue'
11
- // import Demo from '@vue2-client/base-client/components/common/XFormGroup/demo.vue'
12
- // import Demo from '@vue2-client/base-client/components/common/XDescriptions/demo.vue'
13
- // import Demo from '@vue2-client/base-client/components/common/AddressSearchCombobox/demo.vue'
14
- // import Demo from '@vue2-client/base-client/components/common/XFormTable/demo.vue'
15
- // import Demo from '@vue2-client/base-client/components/common/XDataCard/XDataCard.vue'
16
- import Demo1 from '@vue2-client/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue'
17
- import XFormTable from '@vue2-client/base-client/components/common/XFormTable'
26
+ import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
27
+ import { mapState } from 'vuex'
18
28
 
19
29
  export default {
20
- name: 'Example',
30
+ name: 'ChargeQuery',
21
31
  components: {
22
- Demo,
23
- Demo1,
24
32
  XFormTable
25
33
  },
26
- mounted () {
27
- },
28
34
  data () {
29
35
  return {
30
- descConfig: [
31
- {
32
- label: '计划用户总数',
33
- key: 'totalUser'
34
- },
35
- {
36
- label: '计划小区数',
37
- key: 'totalResidentArea'
38
- },
39
- {
40
- label: '已检数',
41
- key: 'doneNum'
42
- },
43
- {
44
- label: '未检数',
45
- key: 'todoNum'
46
- },
47
- {
48
- label: '安检率',
49
- key: 'ratio',
50
- type: 'percent'
51
- }
52
- ],
53
- descData: {
54
- totalUser: 1000,
55
- totalResidentArea: 6,
56
- doneNum: 800,
57
- todoNum: 200,
58
- ratio: 80
59
- },
60
- dataContent: {
61
- c_id: '1240d022903c46c8a510b1f9e61f1ca2',
62
- c_usertype: '民用',
63
- c_plantype: '预约计划',
64
- c_checker: 'wd7',
65
- c_total: 2,
66
- c_done: 1,
67
- c_ratio: 50,
68
- c_planname: '状态测试',
69
- c_month: 8,
70
- todoNum: 1,
71
- totalResidentArea: 1
72
- }
36
+ // 查询配置名称
37
+ queryParamsName: 'ChargeQueryCRUD',
38
+ // 新增表单固定值
39
+ fixedAddForm: {},
40
+ // 是否显示详情抽屉
41
+ detailVisible: false,
42
+ // 当前记录
43
+ record: {}
73
44
  }
74
45
  },
46
+ created () {
47
+ },
48
+ mounted () {
49
+ console.log('==当前登录人', this.currUser)
50
+ },
75
51
  methods: {
76
- }
52
+ action (record, id, actionType) {
53
+ this.detailVisible = true
54
+ console.log('触发了详情操作', record, id, actionType)
55
+ },
56
+ onClose () {
57
+ this.detailVisible = false
58
+ // 关闭详情之后重新查询表单
59
+ this.$refs.xFormTable.refreshTable(true)
60
+ }
61
+ },
62
+ computed: {
63
+ ...mapState('account', { currUser: 'user' }),
64
+ ...mapState('setting', { isMobile: 'isMobile' })
65
+ },
77
66
  }
78
67
  </script>
68
+
79
69
  <style scoped>
80
70
 
81
71
  </style>
@@ -167,9 +167,6 @@ export const indexedDB = {
167
167
  })
168
168
  },
169
169
  getByWeb: function (key, url, params, callback, processFun) {
170
- console.log('db', this.db)
171
- console.log(key)
172
- console.log(locks)
173
170
  // 如果这个键正在被使用,等待它完成
174
171
  if (locks[key]) {
175
172
  locks[key].then(() => {