@idooel/components 0.0.2-beta.17 → 0.0.2-beta.19

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": "@idooel/components",
3
- "version": "0.0.2-beta.17",
3
+ "version": "0.0.2-beta.19",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "dist/@idooel/components.umd.js",
@@ -206,6 +206,7 @@ export default {
206
206
  currentTableSelection: this.currentTableSelection,
207
207
  currentTreeNode: this.currentTreeNodeData,
208
208
  requestTableData: this.requestTableData,
209
+ keepAliveRefresh: this.keepAliveRefresh,
209
210
  refreshTreeData: this.refreshTreeData,
210
211
  querys: this.tableQuerys,
211
212
  currentRowData: this.getCurrentRowData(),
@@ -388,6 +389,7 @@ export default {
388
389
  }
389
390
  },
390
391
  async created () {
392
+ // onSearch会初始化请求表格数据,所以不需要在这里请求表格数据
391
393
  // 确保全局数据池已初始化
392
394
  if (!window.__idooel_data_pool__) {
393
395
  console.error('Global data pool not initialized. Please check if runtime-context/globalDataPool.js is properly imported.')
@@ -430,21 +432,20 @@ export default {
430
432
  this.defaultExpandedKeys = [defaultTreeNode[this.mapFields.key]]
431
433
  this.defaultSelectedKeys = [defaultTreeNode[this.mapFields.key]]
432
434
  this.currentTreeNodeData = defaultTreeNode
433
- }
434
-
435
- const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta
436
- const currentRowData = this.getCurrentRowData()
437
- const ctx = {
438
- ...this.currentTreeNodeData,
439
- _route: this.$route.query,
440
- currentRowData: currentRowData
441
- }
442
-
443
- const initQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))
444
- if (overrideInit) {
445
- this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })
446
- } else {
447
- this.tableData = await this.requestTableData(initQuerys)
435
+ const { params = {}, fieldMap = {}, overrideInit = false } = this.tableMeta
436
+ const currentRowData = this.getCurrentRowData()
437
+ const ctx = {
438
+ ...this.currentTreeNodeData,
439
+ _route: this.$route.query,
440
+ currentRowData: currentRowData
441
+ }
442
+
443
+ const initQuerys = Object.assign({}, params, parseFieldMap(fieldMap, ctx))
444
+ if (overrideInit) {
445
+ this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })
446
+ } else {
447
+ this.tableData = await this.requestTableData(initQuerys)
448
+ }
448
449
  }
449
450
  },
450
451
  methods: {
@@ -639,6 +640,7 @@ export default {
639
640
  if (overrideInit) {
640
641
  this.$emit(RESERVE_EVENT_NAMES.TREE_CHANGE, { ...this.exposed })
641
642
  } else {
643
+ if (this.showTree) return
642
644
  this.tableData = await this.requestTableData()
643
645
  }
644
646
  },
package/vitest.config.js CHANGED
@@ -1,17 +1,17 @@
1
- import { defineConfig } from 'vitest/config'
2
- import vue from '@vitejs/plugin-vue2'
3
- import path from 'path'
4
-
5
- export default defineConfig({
6
- plugins: [vue()],
7
- resolve: {
8
- alias: {
9
- '@': path.resolve(__dirname, 'packages')
10
- }
11
- },
12
- test: {
13
- environment: 'jsdom',
14
- globals: true,
15
- setupFiles: ['__tests__/setup.js']
16
- }
17
- })
1
+ import { defineConfig } from 'vitest/config'
2
+ import vue from '@vitejs/plugin-vue2'
3
+ import path from 'path'
4
+
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ resolve: {
8
+ alias: {
9
+ '@': path.resolve(__dirname, 'packages')
10
+ }
11
+ },
12
+ test: {
13
+ environment: 'jsdom',
14
+ globals: true,
15
+ setupFiles: ['__tests__/setup.js']
16
+ }
17
+ })