@tongfun/tf-widget 0.1.16 → 0.1.21

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.
Files changed (42) hide show
  1. package/.browserslistrc +3 -3
  2. package/.editorconfig +5 -5
  3. package/.eslintrc.js +17 -17
  4. package/README.md +10 -0
  5. package/lib/css/1.841c5d60.css +1 -0
  6. package/lib/tf-widget.common.1.js +10 -18
  7. package/lib/tf-widget.common.js +2574 -5632
  8. package/lib/tf-widget.css +1 -1
  9. package/lib/tf-widget.umd.1.js +10 -18
  10. package/lib/tf-widget.umd.js +2574 -5632
  11. package/lib/tf-widget.umd.min.1.js +1 -1
  12. package/lib/tf-widget.umd.min.js +4 -13
  13. package/package/t-data-list/main.vue +11 -10
  14. package/package/t-data-list/src/js/operatorEnum.js +6 -7
  15. package/package/t-data-list/src/mixins/button-controll-mixin.js +21 -5
  16. package/package/t-data-list/src/t-list-search.vue +5 -1
  17. package/package/t-data-list/src/t-plan/index.vue +16 -11
  18. package/package/t-data-list/src/t-plan/plan-content.vue +10 -17
  19. package/package/t-data-list/src/t-table/index.vue +11 -2
  20. package/package/t-data-list/src/t-table/table-group.vue +7 -6
  21. package/package/t-data-list/src/t-table/table-records-header-popover.vue +0 -4
  22. package/package/t-data-list/src/t-table/table-records.vue +31 -18
  23. package/package/t-input/children/basic.vue +2 -0
  24. package/package/t-input/children/group-components/group-dialog.vue +1 -7
  25. package/package/t-input/children/group.vue +1 -1
  26. package/package/tf-layout/src/components/tf-labelbar.vue +15 -3
  27. package/package/tf-layout/src/tf-layout.vue +27 -7
  28. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +10 -5
  29. package/package.json +3 -2
  30. package/postinstall.js +10 -10
  31. package/src/api/tableV3.js +0 -26
  32. package/src/directives/debounce.js +24 -0
  33. package/src/mixins/t-data-query-mixin.js +8 -7
  34. package/dist/css/chunk-9c7a8e06.920744ef.css +0 -1
  35. package/dist/css/chunk-vendors.de967301.css +0 -1
  36. package/dist/css/index.153bd82e.css +0 -1
  37. package/dist/fonts/element-icons.535877f5.woff +0 -0
  38. package/dist/fonts/element-icons.732389de.ttf +0 -0
  39. package/dist/js/chunk-9c7a8e06.ffff58b5.js +0 -1
  40. package/dist/js/chunk-vendors.45086d09.js +0 -39
  41. package/dist/js/index.52bcef0d.js +0 -1
  42. package/lib/css/1.920744ef.css +0 -1
@@ -22,14 +22,14 @@
22
22
  <el-button v-debounce type="primary" size="mini" @click="refresh(false,true)">刷新 </el-button>
23
23
  <!-- <el-button type="primary" size="mini">批改</el-button> -->
24
24
  <slot name="importAndExport" />
25
- <slot name="buttons" />
25
+ <slot name="buttons" :ids="ids" :rows="selectedRows" />
26
26
  </div>
27
27
 
28
28
  <!-- 搜索输入框 -->
29
- <TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event)" />
29
+ <TListSearch ref="tListSearchRef" class="common-table-buttons-search" @search="handleSuggestMultiCondition($event)" />
30
30
  </div>
31
31
  <!--过滤方案-->
32
- <Tplan :fields-option="tableLayout" @change="handlePlanConditionChange" />
32
+ <Tplan ref="TplanRef" :fields-option="tableLayout" @change="handlePlanConditionChange" />
33
33
  </div>
34
34
 
35
35
  <!--
@@ -51,12 +51,13 @@
51
51
  @dbRowClick 也是双击事件,但是当前行的数据被事件发射出来
52
52
  -->
53
53
  <Ttable
54
+ ref="TtableRef"
54
55
  class="t-table"
55
56
  :layout="tableLayout"
56
57
  :sum="tableSum"
57
58
  show-summary
58
59
  :data="tableData"
59
- :disable-sum="disableSum"
60
+ :enable-sum="enableSum"
60
61
  :enable-group="enableGroup"
61
62
  enable-group-edit
62
63
  :page-size="query.pageSize"
@@ -85,11 +86,15 @@ import Ttable from './src/t-table'
85
86
  import PushDown from './src/pushdown/push-down.vue'
86
87
  import buttonControll from './src/mixins/button-controll-mixin.js'
87
88
  import dataQuery from '@/mixins/t-data-query-mixin.js'
89
+ import debounce from '@/directives/debounce.js'
88
90
  export default {
89
91
  name: 'TDataList',
90
92
  components: {
91
93
  Tplan, Ttable, PushDown, TListSearch
92
94
  },
95
+ directives: {
96
+ debounce
97
+ },
93
98
  mixins: [buttonControll, dataQuery],
94
99
  props: {
95
100
  // 目标单据,接口地址的一部分,单据列表的标识符
@@ -119,7 +124,7 @@ export default {
119
124
  type: Boolean,
120
125
  default: false
121
126
  },
122
- disableSum: {
127
+ enableSum: {
123
128
  type: Boolean,
124
129
  default: false
125
130
  }
@@ -153,7 +158,7 @@ export default {
153
158
  }
154
159
  </script>
155
160
 
156
- <style scoped lang='less'>
161
+ <style lang="less" scoped>
157
162
  // 列表页面的外轮廓
158
163
  .page{
159
164
  height:100%;
@@ -185,8 +190,4 @@ export default {
185
190
  }
186
191
  }
187
192
  }
188
-
189
- // .t-table{
190
- // height: 80vh
191
- // }
192
193
  </style>
@@ -18,8 +18,8 @@ const typeEnum = {
18
18
  ],
19
19
 
20
20
  /**
21
- * 时间类型
22
- */
21
+ * 时间类型
22
+ */
23
23
  // 短时间
24
24
  date: [
25
25
  { label: '大于', value: 'TIME_MORE_SHORT' },
@@ -62,9 +62,8 @@ const typeEnum = {
62
62
  ],
63
63
 
64
64
  /**
65
- * 枚举类型
66
- *
67
- */
65
+ * 枚举类型
66
+ */
68
67
  enum: [
69
68
  { label: '等于', value: 'ENUM_EQUAL', strict: true },
70
69
  { label: '不等于', value: 'ENUM_UNEQUAL', isFrezz: true },
@@ -73,8 +72,8 @@ const typeEnum = {
73
72
  ],
74
73
 
75
74
  /**
76
- * 数字类型
77
- */
75
+ * 数字类型
76
+ */
78
77
  number: [
79
78
  { label: '大于', value: 'NUMBER_MORE' },
80
79
  { label: '大于等于', value: 'NUMBER_MORE_EQUAL' },
@@ -9,6 +9,9 @@ export default {
9
9
  methods: {
10
10
  // 跳转到新增页面
11
11
  insert () {
12
+ if (this.$listeners.insert) {
13
+ return this.$emit('insert')
14
+ }
12
15
  const randomStr = Math.random().toString(36).slice(8)
13
16
  this.$router.replace(`${this.$route.path}/insert/${randomStr}`)
14
17
  },
@@ -20,6 +23,9 @@ export default {
20
23
  if (this.selectedRows.length > 1) {
21
24
  return this.$message.warning('只允许选择一条数据')
22
25
  }
26
+ if (this.$listeners.update) {
27
+ return this.$emit('update', this.selectedRows[0])
28
+ }
23
29
  const randomStr = Math.random().toString(36).slice(8)
24
30
  this.$router.replace(`${this.$route.path}/update/${randomStr}/${this.ids[0]}`)
25
31
  },
@@ -36,9 +42,7 @@ export default {
36
42
  }).then(async () => {
37
43
  const { code, msg } = await del({
38
44
  target: this.target,
39
- params: {
40
- ids: this.ids.join(',')
41
- }
45
+ ids: this.ids
42
46
  })
43
47
  if (code !== 0) {
44
48
  return this.$message.error(msg)
@@ -64,12 +68,24 @@ export default {
64
68
  this.syncData.tableSelectionClear = false
65
69
  }
66
70
  if (clearCondition) {
67
- this.query.conditionAlwaysList = []
71
+ // 清空右上角搜索框的条件
72
+ this.$refs.tListSearchRef.reset()
73
+ this.searchSuggestCondition = []
74
+
75
+ // 清空分组条件
68
76
  this.query.conditionGroup = null
69
- this.query.conditionMultiList = []
77
+
78
+ // 清空表头条件
79
+ // 清空过滤器显示状态,和快捷过滤条件缓存,通过事件方式将操作改为异步提升速度(好像也没有提升多少)
70
80
  this.query.conditionQuickList = []
81
+ this.$refs.TtableRef.$emit('headConditionClear')
82
+
71
83
  this.query.pageNum = 1
72
84
  this.query.pageSize = 200
85
+
86
+ // 通知方案切换到默认方案 ,然后触发查询
87
+ this.$refs.TplanRef.resetToDefaultPlan()
88
+ return
73
89
  }
74
90
  this.getTableData(false, true)
75
91
  }
@@ -13,6 +13,11 @@ export default {
13
13
  return {
14
14
  value: ''
15
15
  }
16
+ },
17
+ methods: {
18
+ reset () {
19
+ this.value = ''
20
+ }
16
21
  }
17
22
 
18
23
  }
@@ -26,7 +31,6 @@ export default {
26
31
  border:none ;
27
32
  border-radius: 0;
28
33
  border-bottom: 1px solid #a7a1a1;
29
-
30
34
  }
31
35
  }
32
36
  </style>
@@ -30,8 +30,8 @@
30
30
  :visible.sync="showExpanse"
31
31
  :plan-names="planNameList"
32
32
  :content="currentPlan"
33
- @listChange="handleListChange"
34
- @change="handleChange"
33
+ @listChange="getFilterPlan"
34
+ @change="$emit('change',$event)"
35
35
  />
36
36
  </div>
37
37
  </template>
@@ -93,7 +93,7 @@ export default {
93
93
  methods: {
94
94
  /**
95
95
  * 获取方案列表
96
- * 并切换到指定方案(选中状态)
96
+ * 并切换到指定方案(为选中状态)
97
97
  */
98
98
  async getFilterPlan (selectId) {
99
99
  const res = await getFilterPlan(this.target)
@@ -102,7 +102,6 @@ export default {
102
102
  }
103
103
  this.planList = res.data
104
104
  this.currentPlanId = selectId || this.planList.find(item => item.isDefault).id
105
- !selectId && this.$refs.planContentRef.$emit('doSearch')
106
105
  },
107
106
 
108
107
  /**
@@ -112,6 +111,18 @@ export default {
112
111
  this.getFilterPlan(planId)
113
112
  },
114
113
 
114
+ /**
115
+ * 将方案重置到默认方案
116
+ */
117
+ resetToDefaultPlan () {
118
+ const defaultPlanContent = this.planList.find(item => item.isDefault)
119
+ const defaultPlanId = defaultPlanContent?.id
120
+ if (this.currentPlanId === defaultPlanId) {
121
+ return this.$refs.planContentRef.loadPlanContent(defaultPlanContent, true)
122
+ }
123
+ this.currentPlanId = defaultPlanId
124
+ },
125
+
115
126
  /**
116
127
  * 方案被点击切换方法并查询数据
117
128
  */
@@ -120,15 +131,9 @@ export default {
120
131
  return
121
132
  }
122
133
  this.currentPlanId = planId
123
- this.$refs.planContentRef.$emit('doSearch')
134
+ // this.$refs.planContentRef.$emit('doSearch')
124
135
  },
125
136
 
126
- /**
127
- *
128
- */
129
- handleChange (condition) {
130
- this.$emit('change', condition)
131
- },
132
137
  /**
133
138
  * 方案列表的拖动
134
139
  */
@@ -86,7 +86,6 @@ export default {
86
86
  },
87
87
  data () {
88
88
  return {
89
- doSearch: false,
90
89
  errorMsg: '',
91
90
  planContent: {
92
91
  name: '',
@@ -98,29 +97,23 @@ export default {
98
97
  inject: ['target'],
99
98
  watch: {
100
99
  content (newValue) {
101
- const contentCopy = JSON.parse(JSON.stringify(newValue))
102
- // 后端大佬骗人,高级过滤条件没有值不一定都是空数组,还有可能是null
100
+ this.loadPlanContent(newValue)
101
+ }
102
+ },
103
+ methods: {
104
+ // 加载一个方案数据,处理方案的数据,并发射条件变更事件
105
+ loadPlanContent (content, immediate = false) {
106
+ const contentCopy = JSON.parse(JSON.stringify(content))
103
107
  contentCopy.contentsList = contentCopy.contentsList || []
104
- // 后端大佬没有给常用默认值的时候,前端自行添加默认值
105
108
  for (const alwaysItem of contentCopy.schemeUsefulList) {
106
109
  if (!alwaysItem.values.length) {
107
110
  alwaysItem.values.push('-1')
108
111
  }
109
112
  }
110
-
111
113
  this.planContent = contentCopy
112
- if (this.doSearch) {
113
- this.conditionChange()
114
- this.doSearch = false
115
- }
116
- }
117
- },
118
- created () {
119
- this.$on('doSearch', () => {
120
- this.doSearch = true
121
- })
122
- },
123
- methods: {
114
+ this.conditionChange()
115
+ },
116
+ // 点击方案内容外侧收起方案详情弹窗
124
117
  handleClickOut () {
125
118
  if (!this.visible) return
126
119
  this.$emit('update:visible', false)
@@ -8,10 +8,11 @@
8
8
  <!-- 表格记录 -->
9
9
  <div class="t-table-right">
10
10
  <TableRecords
11
+ ref="tableRecordsRef"
11
12
  :layout="layout"
12
13
  :is-selector="isSelector"
13
14
  :sum="sum"
14
- :disable-sum="disableSum"
15
+ :enable-sum="enableSum"
15
16
  :data="data"
16
17
  :update-in-dialog="updateInDialog"
17
18
  :page-size="pageSize"
@@ -78,7 +79,7 @@ export default {
78
79
  type: Boolean,
79
80
  default: false
80
81
  },
81
- disableSum: {
82
+ enableSum: {
82
83
  type: Boolean,
83
84
  default: false
84
85
  }
@@ -88,6 +89,14 @@ export default {
88
89
 
89
90
  }
90
91
  },
92
+ created () {
93
+ this.$on('headConditionClear', () => {
94
+ this.$refs.tableRecordsRef.initTableFilterData()
95
+ })
96
+ },
97
+ beforeDestroy () {
98
+ this.$off('headConditionClear')
99
+ },
91
100
  provide () {
92
101
  return {
93
102
  enableGroupEdit: this.enableGroupEdit
@@ -4,7 +4,7 @@
4
4
  <el-input v-model="search" placeholder="请输入节点名称" />
5
5
 
6
6
  <!-- 节点展示 -->
7
- <el-scrollbar class="scrollbar">
7
+ <el-scrollbar :class="[queryType === 'LIST' ? 'scrollbar' :'in-selector']">
8
8
  <el-tree
9
9
  ref="treeRef"
10
10
  :data="dataTree"
@@ -75,7 +75,7 @@ export default {
75
75
  this.$refs.treeRef.filter(value)
76
76
  }
77
77
  },
78
- inject: ['target'],
78
+ inject: ['target', 'queryType'],
79
79
  created () {
80
80
  this.getGroupTree()
81
81
  },
@@ -154,16 +154,17 @@ export default {
154
154
 
155
155
  <style scoped lang='less'>
156
156
  .table-group {
157
- height:100%;
157
+ height:70vh;
158
158
  .scrollbar{
159
- height:calc(100% - 40px);
159
+ height:70vh;
160
+ }
161
+ .in-selector {
162
+ height:53vh;
160
163
  }
161
164
  ::v-deep .el-scrollbar__wrap {
162
165
  overflow-x:hidden;
163
166
  }
164
167
  background-color: #fff;
165
- // margin-right:10px;
166
- // border-radius:5px;
167
168
  box-sizing: border-box;
168
169
  border: 1px solid #e8eaec;
169
170
  border-right: 0px;
@@ -2,7 +2,6 @@
2
2
  <!-- 排序的提示插件 -->
3
3
  <div>
4
4
  <el-popover
5
-
6
5
  :value="item.isShowFilter"
7
6
  width="200"
8
7
  trigger="manual"
@@ -21,7 +20,6 @@
21
20
  <div class="list-icon">
22
21
  <i v-show="radioItem.value === tableFilterData[item.field].operator" class="el-icon-check" />
23
22
  </div>
24
-
25
23
  </div>
26
24
  </div>
27
25
  <div class="context-list header-input">
@@ -55,7 +53,6 @@
55
53
  <div class="list-icon">
56
54
  <i v-show="tableFilterData[item.field].value.includes(option.enumId)" class="el-icon-check" />
57
55
  </div>
58
-
59
56
  </div>
60
57
  </div>
61
58
  <div class="context-list">
@@ -71,7 +68,6 @@
71
68
  style=""
72
69
  @mouseup.stop="handleFilterClick"
73
70
  />
74
-
75
71
  </el-popover>
76
72
  </div>
77
73
  </template>
@@ -1,5 +1,7 @@
1
1
  <template>
2
2
  <div ref="tableRecords" class="table-records">
3
+ <!-- {{ tableFilterData }} -->
4
+ <!-- {{ layout }} -->
3
5
  <div class="table-wrapper">
4
6
  <ux-grid
5
7
  ref="dataRecordsRef"
@@ -8,7 +10,7 @@
8
10
  size="mini"
9
11
  column-key
10
12
  beautify-table
11
- :show-summary="showSummary && !disableSum"
13
+ :show-summary="showSummaryComp"
12
14
  :summary-method="summaryMethod"
13
15
  :width-resize="true"
14
16
  :highlight-current-row="false"
@@ -107,7 +109,7 @@ export default {
107
109
  type: Boolean,
108
110
  default: false
109
111
  },
110
- disableSum: {
112
+ enableSum: {
111
113
  type: Boolean,
112
114
  default: false
113
115
  }
@@ -124,21 +126,21 @@ export default {
124
126
  }
125
127
  },
126
128
  computed: {
127
-
129
+ showSummaryComp () {
130
+ return this.queryType === 'LIST'
131
+ }
128
132
  },
129
133
  watch: {
130
134
  layout: {
131
135
  handler (newVal) {
132
- // 初始化绑定tableFilterData
133
- // 如果tableFilterData有内容则抛出
134
136
  if (Object.keys(this.tableFilterData).length !== 0) {
135
137
  return
136
138
  }
137
- // 初始化tableFilterData的数据
138
- newVal.length > 0 && newVal.forEach(e => {
139
- if (e.isId) this.idField = e.field
140
- this.$set(this.tableFilterData, e.field, { field: e.field, operator: '', value: '', fieldType: e.componentType })
141
- })
139
+ this.initTableFilterData()
140
+ // newVal.length > 0 && newVal.forEach(e => {
141
+ // if (e.isId) this.idField = e.field
142
+ // this.$set(this.tableFilterData, e.field, { field: e.field, operator: '', value: '', fieldType: e.componentType })
143
+ // })
142
144
  },
143
145
  immediate: true
144
146
  },
@@ -175,10 +177,18 @@ export default {
175
177
  }
176
178
  },
177
179
  methods: {
178
- handleClearSelected () {
179
- this.$refs.dataRecordsRef.clearSelection()
180
- this.clearSelectedRows()
180
+ /**
181
+ * 表头过滤
182
+ */
183
+ // 初始化或清空表头过滤的缓存容器
184
+ initTableFilterData () {
185
+ this.layout.length && this.layout.forEach(e => {
186
+ if (e.isId) this.idField = e.field
187
+ this.$set(this.tableFilterData, e.field, { field: e.field, operator: '', value: '', fieldType: e.componentType })
188
+ this.$set(e, 'isShowIcon', false)
189
+ })
181
190
  },
191
+ // 表头过滤触发了过滤事件
182
192
  filterClick (value, index) {
183
193
  if (!this.isSingleFilter) {
184
194
  return
@@ -189,6 +199,10 @@ export default {
189
199
  }
190
200
  this.filterSelectedId = index
191
201
  },
202
+ handleClearSelected () {
203
+ this.$refs.dataRecordsRef.clearSelection()
204
+ this.clearSelectedRows()
205
+ },
192
206
  // 清空已选
193
207
  clearSelectedRows () {
194
208
  this.selectedRows.splice(0, this.selectedRows.length)
@@ -276,7 +290,10 @@ export default {
276
290
  ::v-deep .plTableBox{
277
291
  .elx-table--body-wrapper{
278
292
  height: calc(90vh - 230px );//修改以适应合计行的添加,
279
- // margin-bottom: 10px;
293
+ overflow-x:hidden;
294
+ }
295
+ .elx-table:not(.is--empty).show--foot.scroll--x .elx-table--body-wrapper{
296
+ overflow-x: hidden !important;
280
297
  }
281
298
  .elx-table--footer-wrapper{
282
299
  margin-top: 0px!important;
@@ -317,8 +334,4 @@ export default {
317
334
  }
318
335
  }
319
336
  }
320
- ::v-deep .elx-table:not(.is--empty).show--foot.scroll--x .elx-table--body-wrapper{
321
- overflow-x: hidden !important;
322
- }
323
-
324
337
  </style>
@@ -28,6 +28,7 @@
28
28
  :modal-append-to-body="modalAppendToBody"
29
29
  @open="getTableData"
30
30
  >
31
+ <!-- {{ limitation }} -->
31
32
  <div class="dataDialog">
32
33
  <Ttable
33
34
  class="t-table"
@@ -222,6 +223,7 @@ export default {
222
223
  position: relative;
223
224
  .plTableBox .elx-table--body-wrapper{
224
225
  height: calc(59vh - 80px);
226
+ overflow-x:scroll;
225
227
  }
226
228
  .el-pagination{
227
229
  right: 0;
@@ -142,13 +142,7 @@ export default {
142
142
  },
143
143
  computed: {
144
144
  groupList () {
145
- let list = []
146
- if (this.data && this.data[0]) {
147
- list = this.data[0]
148
- }
149
- // todo: 下面的方式eslint报错,而且下面的是啥逻辑啊,需要追踪数据后确定
150
- // return this.data[0] && this.data || []
151
- return list
145
+ return (this.data && this.data[0]) || []
152
146
  },
153
147
  selectMap () {
154
148
  return this.createSelectMap(this.data)
@@ -32,7 +32,7 @@
32
32
 
33
33
  <script>
34
34
  import { getGroupTree } from '@/api/tableV3.js'
35
- import GroupDialog from '../children/group-components/group-dialog.vue'
35
+ import GroupDialog from './group-components/group-dialog'
36
36
  // 使用该组件必穿一个target
37
37
 
38
38
  export default {
@@ -112,7 +112,8 @@ export default {
112
112
  }
113
113
  if (!meta.noCache) {
114
114
  const cacheArr = newValue.matched.map(item => item.name)
115
- this.$emit('setCache', cacheArr)
115
+ const cacheObj = this.tagList.find(item => item.path === obj.path)
116
+ if(!cacheObj) this.$emit('setCache', cacheArr)
116
117
  obj.cacheArr = cacheArr
117
118
  }
118
119
  if (obj.defaultRoute) {
@@ -235,13 +236,24 @@ export default {
235
236
  /**
236
237
  * 关闭tag
237
238
  */
238
- closeTag: function (tagItem) {
239
- if (tagItem.cacheArr) this.$emit('deleteCache', [tagItem.cacheArr])
239
+ closeTag: function (tagItem, deleteCacheArr = true) {
240
+ if (tagItem.cacheArr && deleteCacheArr) this.$emit('deleteCache', [tagItem.cacheArr])
240
241
  const num = this.tagList.indexOf(tagItem)
241
242
  if (tagItem) {
242
243
  this.tagList.splice(num, 1)
243
244
  this.routeJump(this.tagList[num - 1])
244
245
  }
246
+ },
247
+ /**
248
+ * 关闭当前标签页
249
+ */
250
+ closeDynamicRoutingTag () {
251
+ const nameArr = this.tagList.map(d => d.name === this.$route.name)
252
+ const tagItem = this.tagList.find(d => d.path === this.$route.path)
253
+ if (tagItem) {
254
+ // 如果tagList中存在两个及以上相同name路由,表明不能删除该缓存
255
+ this.closeTag(tagItem, !(nameArr.length > 1))
256
+ }
245
257
  }
246
258
  }
247
259
  }
@@ -6,6 +6,7 @@
6
6
  />
7
7
  <div class="tf-layout-subject">
8
8
  <TfLaberBar
9
+ ref="TfLaberBar"
9
10
  :route-base="routeBase"
10
11
  @setCache="setCache"
11
12
  @changeMenuState="changeMenuState"
@@ -43,6 +44,7 @@ export default {
43
44
  },
44
45
  data () {
45
46
  return {
47
+ currencyCache: {},
46
48
  menuState: false,
47
49
  cacheMap: new Map(),
48
50
  secondCacheArray: [],
@@ -54,8 +56,14 @@ export default {
54
56
  this.menuState = state
55
57
  },
56
58
  setCache (value) {
57
- this.cacheMap.set(value[2] || value[1], value[1])
58
- this.initCacheArr()
59
+ const key = value[2] || value[1]
60
+ if(this.cacheMap.get(key)) {
61
+ if(!this.currencyCache[key] || this.currencyCache[key] < 0) this.$set(this.currencyCache, key, 0)
62
+ this.currencyCache[key] += 1
63
+ } else {
64
+ this.cacheMap.set(key, value[1])
65
+ this.initCacheArr()
66
+ }
59
67
  },
60
68
  initCacheArr () {
61
69
  this.secondCacheArray.push(
@@ -78,11 +86,23 @@ export default {
78
86
  deleteCache (value) {
79
87
  if (Array.isArray(value)) {
80
88
  value.forEach((item) => {
81
- this.cacheMap.delete(item[2] || item[1])
82
- this.thirdCacheArr.splice(
83
- this.thirdCacheArr.indexOf(item[2] || item[1]),
84
- 1
85
- )
89
+ const key = item[2] || item[1]
90
+ if(`${this.currencyCache[key]}` && this.currencyCache[key] >= 0) {
91
+ this.currencyCache[key] -= 1
92
+ if(this.currencyCache[key] < 0) {
93
+ this.cacheMap.delete(key)
94
+ this.thirdCacheArr.splice(
95
+ this.thirdCacheArr.indexOf(key),
96
+ 1
97
+ )
98
+ }
99
+ } else {
100
+ this.cacheMap.delete(key)
101
+ this.thirdCacheArr.splice(
102
+ this.thirdCacheArr.indexOf(key),
103
+ 1
104
+ )
105
+ }
86
106
  if ([...this.cacheMap.values()].indexOf(item[1]) === -1) {
87
107
  this.secondCacheArray.splice(
88
108
  this.secondCacheArray.indexOf(item[2]),
@@ -55,6 +55,7 @@
55
55
  :table-data="pageData.commonTableData"
56
56
  :table-layout="pageData.commonTableLayout"
57
57
  :paging="pageData.paging"
58
+ :head-name="pageData.headName"
58
59
  :total-data="pageData.totalData"
59
60
  :single-select="true"
60
61
  :quick-filter-data="pageData.quickFilterData"
@@ -254,11 +255,15 @@ export default {
254
255
  },
255
256
  deep: true
256
257
  },
257
- tableId (newVal, oldVal) {
258
- if (oldVal !== newVal) {
259
- this.DetermineWhetherTheTableidTasChanged = true
260
- this.pageData.tableId = newVal
261
- }
258
+ tableId: {
259
+ handler (newVal, oldVal) {
260
+ if (oldVal !== newVal && newVal) {
261
+ this.DetermineWhetherTheTableidTasChanged = true
262
+ this.pageData.tableId = newVal
263
+ this.initTable()
264
+ }
265
+ },
266
+ immediate: true
262
267
  },
263
268
  dialogVisible (newVal) {
264
269
  if (!this.DetermineWhetherTheTableidTasChanged) {