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

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.16",
3
+ "version": "0.0.2-beta.17",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "dist/@idooel/components.umd.js",
@@ -18,7 +18,7 @@
18
18
  您可以请点击上方按钮查看任务进度或关闭弹框
19
19
  </div>
20
20
  </div>
21
- <div v-if="!isFileEmpty && statusList.length > 0 && mode === 'sync'" class="ele-modal-import__errors">
21
+ <div v-if="!isFileEmpty && mode === 'sync'" class="ele-modal-import__errors">
22
22
  <template v-if="statusList.length > 0">
23
23
  <div v-for="(value, idx) in statusList" :key="idx">
24
24
  {{ value.message }}
@@ -126,8 +126,8 @@ export default {
126
126
  const ctx = { _route: this.$route.query, route: this.$route, ...payloads }
127
127
  return parseFieldMap(fieldMap, ctx)
128
128
  },
129
- buildErrorList (dataSrouce = []) {
130
- const ret = dataSrouce.map(item => {
129
+ buildErrorList (dataSource = []) {
130
+ const ret = dataSource.map(item => {
131
131
  if (type.isStr(item)) {
132
132
  return {
133
133
  statusCode: '0',
@@ -154,7 +154,7 @@ export default {
154
154
  net[requestType.toLowerCase()](url, formData , { headers: { 'Content-Type': 'multipart/form-data' } }).then(resp => {
155
155
  const { code, data } = resp
156
156
  if (code !== '2000') {
157
- this.innerErrorList = this.buildErrorList(data)
157
+ this.innerErrorList = this.buildErrorList(data || [])
158
158
  } else {
159
159
  this.innerErrorList = []
160
160
  }
@@ -671,8 +671,7 @@ export default {
671
671
  },
672
672
  async requestTableData (props = {}) {
673
673
  const { url, requestType = 'GET', page = {} } = this.tableMeta
674
- const { pageSize = 10 } = page
675
- this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: 1, pageSize }, props)
674
+ this.tableQuerys = Object.assign(this.tableQuerys, { currentPage: this.tableQuerys.currentPage || 1, pageSize: this.tableQuerys.pageSize || 10 }, props)
676
675
  this.$emit(RESERVE_EVENT_NAMES.WATCH, { ...this.exposed })
677
676
  this.loading = true
678
677
  const ret = await net[requestType.toLowerCase()](
@@ -706,6 +705,24 @@ export default {
706
705
  const modelTableContainerRef = this.$refs[this.modelTableContainerRef]
707
706
  const { height } = modelTableContainerRef.getBoundingClientRect()
708
707
  this.treeWrapperHeight = height
708
+ },
709
+ async keepAliveRefresh () {
710
+ // 重新计算表格高度(应对窗口大小变化)
711
+ this.$nextTick(() => {
712
+ this.calculateTableHeight()
713
+ if (this.showTree) {
714
+ this.calculateTreeHeight()
715
+ }
716
+ })
717
+ // 刷新列表数据
718
+ const { overrideInit = false } = this.tableMeta
719
+ if (overrideInit) {
720
+ // 如果使用自定义初始化模式,触发 INIT 事件
721
+ this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })
722
+ } else {
723
+ // 使用当前查询参数刷新表格数据
724
+ await this.requestTableData(this.tableQuerys)
725
+ }
709
726
  }
710
727
  },
711
728
  mounted () {
@@ -739,23 +756,7 @@ export default {
739
756
  }
740
757
  },
741
758
  async activated () {
742
- // 重新计算表格高度(应对窗口大小变化)
743
- this.$nextTick(() => {
744
- this.calculateTableHeight()
745
- if (this.showTree) {
746
- this.calculateTreeHeight()
747
- }
748
- })
749
-
750
- // 刷新列表数据
751
- const { overrideInit = false } = this.tableMeta
752
- if (overrideInit) {
753
- // 如果使用自定义初始化模式,触发 INIT 事件
754
- this.$emit(RESERVE_EVENT_NAMES.INIT, { ...this.exposed })
755
- } else {
756
- // 使用当前查询参数刷新表格数据
757
- await this.requestTableData()
758
- }
759
+ await this.keepAliveRefresh()
759
760
  }
760
761
  }
761
762
  </script>