@tongfun/tf-widget 0.1.14 → 0.1.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.
Files changed (43) hide show
  1. package/.browserslistrc +3 -3
  2. package/.editorconfig +5 -5
  3. package/.eslintrc.js +17 -17
  4. package/README.md +3 -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 +2777 -5559
  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 +2777 -5559
  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 +6 -5
  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-icon-picker/README.md +8 -0
  27. package/package/tf-icon-picker/index.js +8 -0
  28. package/package/tf-icon-picker/src/tf-icon-picker.vue +266 -0
  29. package/package/tf-layout/src/components/tf-menu.vue +1 -1
  30. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +10 -5
  31. package/package.json +1 -1
  32. package/postinstall.js +10 -10
  33. package/src/index.js +5 -2
  34. package/src/mixins/t-data-query-mixin.js +8 -7
  35. package/dist/css/chunk-9c7a8e06.920744ef.css +0 -1
  36. package/dist/css/chunk-vendors.de967301.css +0 -1
  37. package/dist/css/index.153bd82e.css +0 -1
  38. package/dist/fonts/element-icons.535877f5.woff +0 -0
  39. package/dist/fonts/element-icons.732389de.ttf +0 -0
  40. package/dist/js/chunk-9c7a8e06.ffff58b5.js +0 -1
  41. package/dist/js/chunk-vendors.45086d09.js +0 -39
  42. package/dist/js/index.52bcef0d.js +0 -1
  43. package/lib/css/1.920744ef.css +0 -1
@@ -0,0 +1,266 @@
1
+ <template>
2
+ <div>
3
+ <el-popover
4
+ v-model="visible"
5
+ :placement="placement"
6
+ :width="width"
7
+ trigger="manual"
8
+ >
9
+ <div class="content-view">
10
+ <div class="search-box">
11
+ <svg-icon
12
+ v-if="selectIconClass"
13
+ :icon-class="selectIconClass.font_class"
14
+ />
15
+ <span v-if="selectIconClass">{{ selectIconClass.name }}</span>
16
+ <el-input
17
+ v-model="search"
18
+ size="mini"
19
+ style="width: 50%"
20
+ clearable
21
+ @clear="cleanSearch"
22
+ />
23
+ <el-button
24
+ size="mini"
25
+ @click="searchInfo"
26
+ >搜索</el-button>
27
+ </div>
28
+ <el-empty
29
+ v-if="!iconList || iconList.length === 0"
30
+ description="暂无数据!"
31
+ style="height: 270px;width: 100%"
32
+ />
33
+ <div
34
+ v-for="item in iconList"
35
+ :key="item.unicode_decimal"
36
+ class="icon-item"
37
+ @click="selectIcon(item)"
38
+ >
39
+ <el-tooltip
40
+ placement="top"
41
+ >
42
+ <div slot="content">
43
+ <span>图标名称: {{ item.name }}</span>
44
+ <br>
45
+ <br>
46
+ <span>class: {{ item.font_class }}</span>
47
+ </div>
48
+ <div class="icon-box">
49
+
50
+ <svg-icon
51
+ :icon-class="item.font_class"
52
+ />
53
+ <span :title="item.name">{{ item.name }}</span>
54
+ </div>
55
+ </el-tooltip>
56
+ </div>
57
+ <div class="paging">
58
+ <span>第 {{ pagination + 1 }} 页</span>
59
+ <el-pagination
60
+ small
61
+ background
62
+ layout="total, prev, next"
63
+ :total="total"
64
+ @current-change="handleCurrentChange"
65
+ />
66
+
67
+ <el-button
68
+ type="info"
69
+ size="mini"
70
+ @click="visible = false"
71
+ >取消</el-button>
72
+ <el-button
73
+ class="button"
74
+ size="mini"
75
+ @click="select"
76
+ >确定</el-button>
77
+ </div>
78
+ </div>
79
+ <el-button
80
+ slot="reference"
81
+ class="button"
82
+ :size="bottomSize"
83
+ @click="visible = !visible; selectIconClass = null"
84
+ >{{ hint }}</el-button>
85
+ </el-popover>
86
+ </div>
87
+ </template>
88
+
89
+ <script>
90
+ import axios from 'axios'
91
+ export default {
92
+ name: 'TfIconPicker',
93
+ props: {
94
+ width: {
95
+ default: 400,
96
+ type: Number
97
+ },
98
+ placement: {
99
+ default: 'bottom',
100
+ type: String
101
+ },
102
+ bottomSize: {
103
+ default: 'small',
104
+ type: String
105
+ },
106
+ hint: {
107
+ default: '选择图标',
108
+ type: String
109
+ }
110
+ },
111
+ data () {
112
+ return {
113
+ glyphsList: null,
114
+ allIconList: null,
115
+ pagination: 0,
116
+ iconList: null,
117
+ total: 0,
118
+ selectIconClass: null,
119
+ visible: false,
120
+ search: null
121
+ }
122
+ },
123
+ watch: {
124
+ pagination: {
125
+ handler: function (newValue) {
126
+ if (!this.glyphsList) return
127
+ this.iconList = this.allIconList.slice(newValue * 20, (newValue + 1) * 20)
128
+ },
129
+ immediate: true
130
+ }
131
+ },
132
+ created () {
133
+ axios.get('/icon-list.json').then((res) => {
134
+ if (res.status === 200) {
135
+ const { glyphs: glyphsList } = res.data
136
+ this.glyphsList = glyphsList.sort((a, b) => a.font_class - b.font_class)
137
+ this.allIconList = JSON.parse(JSON.stringify(this.glyphsList))
138
+ this.total = this.allIconList?.length
139
+ this.iconList = this.allIconList.slice(this.pagination * 20, (this.pagination + 1) * 20)
140
+ }
141
+ })
142
+ },
143
+ methods: {
144
+ handleCurrentChange (val) {
145
+ if (val - 1 > this.total / 20) return
146
+ this.pagination = val - 1
147
+ },
148
+ selectIcon (params) {
149
+ this.selectIconClass = params
150
+ },
151
+ searchInfo () {
152
+ this.pagination = 0
153
+ const glyphs = JSON.parse(JSON.stringify(this.glyphsList))
154
+ const iconArr = []
155
+ glyphs.forEach(item => {
156
+ const str = `${item.font_class}+${item.name}`.toLowerCase()
157
+ if (str.indexOf(this.search.toLowerCase()) !== -1) {
158
+ iconArr.push(item)
159
+ }
160
+ })
161
+ this.allIconList = iconArr
162
+ this.total = this.allIconList.length
163
+ if (iconArr.length > 20) {
164
+ this.iconList = this.allIconList.slice(this.pagination * 20, (this.pagination + 1) * 20).sort((a, b) => a.font_class - b.font_class)
165
+ } else {
166
+ this.iconList = iconArr.sort((a, b) => a.font_class - b.font_class)
167
+ }
168
+ },
169
+ cleanSearch () {
170
+ this.pagination = 0
171
+ this.allIconList = JSON.parse(JSON.stringify(this.glyphsList))
172
+ this.total = this.allIconList?.length
173
+ this.iconList = this.allIconList.slice(this.pagination * 20, (this.pagination + 1) * 20)
174
+ },
175
+ select () {
176
+ if (this.selectIconClass) {
177
+ this.$emit('selectIcon', JSON.parse(JSON.stringify(this.selectIconClass)))
178
+ } else {
179
+ this.$message.error('未选择图标')
180
+ }
181
+ this.selectIconClass = null
182
+ this.visible = false
183
+ }
184
+ }
185
+ }
186
+ </script>
187
+
188
+ <style lang="less" scoped>
189
+ .content-view {
190
+ min-height: 300px;
191
+ display: flex;
192
+ justify-content: left;
193
+ align-items: center;
194
+ flex-wrap: wrap;
195
+ align-content: flex-start;
196
+ .search-box {
197
+ width: 100%;
198
+ display: flex;
199
+ justify-content: left;
200
+ align-items: center;
201
+ gap: 0 10px;
202
+ color: red;
203
+ .svg-icon {
204
+ height: 20px;
205
+ width: 20px;
206
+ }
207
+ }
208
+ .icon-item {
209
+ width: 20%;
210
+ height: 60px;
211
+ display: flex;
212
+ margin-top: 10px;
213
+ align-items: center;
214
+ justify-content: center;
215
+ .icon-box {
216
+ box-sizing: border-box;
217
+ padding: 5px 0;
218
+ border-radius: 2px;
219
+ border: 1px solid #eeeeee;
220
+ display: inherit;
221
+ flex-direction: column;
222
+ justify-content: space-between;
223
+ align-items: center;
224
+ width: 60px;
225
+ height: 100%;
226
+ color: #666666;
227
+ &:hover {
228
+ color: #2a90e9;
229
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
230
+ }
231
+ .svg-icon {
232
+ height: 25px;
233
+ width: 25px;
234
+ }
235
+ span {
236
+ line-height: 1;
237
+ box-sizing: border-box;
238
+ padding: 0 2px;
239
+ text-align: center;
240
+ width: 60px;
241
+ display: inline-block;
242
+ white-space: nowrap;
243
+ overflow: hidden;
244
+ text-overflow: ellipsis;
245
+ cursor: pointer;
246
+ font-size: 12px;
247
+ }
248
+ }
249
+ }
250
+ .paging {
251
+ display: flex;
252
+ justify-content: right;
253
+ align-items: center;
254
+ margin-top: 10px;
255
+ height: 20px;
256
+ width: 100%;
257
+ }
258
+ }
259
+ .button {
260
+ opacity: 1;
261
+ background: #0c4c8e;
262
+ border-radius: 2px;
263
+ font-weight: 700;
264
+ color: #FFFFFF;
265
+ }
266
+ </style>
@@ -34,7 +34,7 @@
34
34
  :index="secondMenuItem.path"
35
35
  >
36
36
  <svg-icon
37
- :icon-class="firstMenuItem.icon"
37
+ :icon-class="secondMenuItem.icon"
38
38
  style="height: 15px; width: 15px; margin-right: 10px"
39
39
  />
40
40
  <span>{{ secondMenuItem.title }}</span>
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tongfun/tf-widget",
3
- "version": "0.1.14",
3
+ "version": "0.1.19",
4
4
  "description": "tf-widget",
5
5
  "main": "lib/tf-widget.umd.js",
6
6
  "private": false,
package/postinstall.js CHANGED
@@ -1,10 +1,10 @@
1
-
2
- const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
3
- '\u001B[96mWe need the best of you! Come and join us\n\n' +
4
- '\u001B[96mWe are waiting for you\n'
5
-
6
- function showBanner () {
7
- console.log(BANNER)
8
- }
9
-
10
- showBanner()
1
+
2
+ const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
3
+ '\u001B[96mWe need the best of you! Come and join us\n\n' +
4
+ '\u001B[96mWe are waiting for you\n'
5
+
6
+ function showBanner () {
7
+ console.log(BANNER)
8
+ }
9
+
10
+ showBanner()
package/src/index.js CHANGED
@@ -4,12 +4,14 @@ import SvgIcon from '../package/svg-icon'
4
4
  import TfLayout from '../package/tf-layout'
5
5
  import TDataList from '../package/t-data-list'
6
6
  import Tinput from '../package/t-input'
7
+ import TfIconPicker from '../package/tf-icon-picker'
7
8
  const components = [
8
9
  TfWidget,
9
10
  SvgIcon,
10
11
  TfLayout,
11
12
  TDataList,
12
- Tinput
13
+ Tinput,
14
+ TfIconPicker
13
15
  ]
14
16
 
15
17
  const install = function (Vue) {
@@ -24,5 +26,6 @@ export default {
24
26
  SvgIcon,
25
27
  TfLayout,
26
28
  TDataList,
27
- Tinput
29
+ Tinput,
30
+ TfIconPicker
28
31
  }
@@ -6,7 +6,7 @@ export default {
6
6
  /**
7
7
  * 通用过滤查询参数
8
8
  */
9
- // 搜索建议和右上角全局搜索的快速搜索条件(因为接口进行了复用)
9
+ // 被指定为搜索建议的查询的字段列表
10
10
  suggestFieldList: [],
11
11
  // 搜索建议的高级条件
12
12
  searchSuggestCondition: [],
@@ -96,7 +96,6 @@ export default {
96
96
  multiResult.forEach((item, index) => {
97
97
  item.sort = index
98
98
  })
99
-
100
99
  return multiResult
101
100
  },
102
101
  // 限定查询范围的条件
@@ -106,14 +105,14 @@ export default {
106
105
  }
107
106
  const result = []
108
107
  for (const key in this.limitation) {
109
- const fieldItem = this.tableLayout.find(v => v.filed === key)
108
+ const fieldItem = this.tableLayout.find(v => v.field === key)
110
109
  if (!fieldItem) continue
111
110
 
112
111
  let value = ''
113
112
  if (fieldItem.componentValueType === 'PARAM_BASIC') {
114
- value = this.limitation[key].name
113
+ value = this.limitation[key]?.name
115
114
  } else if (fieldItem.componentValueType === 'PARAM_ENUM') {
116
- value = this.limitation[key].id
115
+ value = this.limitation[key]?.id
117
116
  } else {
118
117
  value = this.limitation[key]
119
118
  }
@@ -175,7 +174,7 @@ export default {
175
174
  pageSize: 20
176
175
  }
177
176
 
178
- !this.disableSum && getSum && await this.getTableSum()
177
+ this.enableSum && getSum && await this.getTableSum()
179
178
  try {
180
179
  // 查询数据之前赋值高级过滤条件
181
180
  queryParams.conditionMultiList = this.multiCondition
@@ -188,12 +187,13 @@ export default {
188
187
  if (isSuggest) {
189
188
  return res.data.record
190
189
  }
191
- this.syncData.tableLoading = false
192
190
  this.tableData.total = Number(res.data.total)
193
191
  this.tableData.records = res.data.record
194
192
  } catch (err) {
195
193
  // 恢复成默认值
196
194
  this.syncData.tableSelectionClear = true
195
+ } finally {
196
+ this.syncData.tableLoading = false
197
197
  }
198
198
  },
199
199
  // 表格数据合计
@@ -268,6 +268,7 @@ export default {
268
268
  // 每页条数变化
269
269
  handleSizeChange (newSize) {
270
270
  this.query.pageSize = newSize
271
+ this.query.pageNum = 1
271
272
  this.getTableData(false, false)
272
273
  },
273
274
  // 翻页
@@ -1 +0,0 @@
1
- .el-popover .context-list .list-item[data-v-fcd31cd8]{display:flex;margin:1px 0;padding:2px 8px;justify-content:space-between}.el-popover .context-list .list-item[data-v-fcd31cd8]:hover{background-color:#e7ebfd}.el-popover .context-list .list-item-active[data-v-fcd31cd8]{color:#3b68fc;background-color:#e7ebfd}.el-popover .context-list[data-v-fcd31cd8] .el-input .el-input__inner{height:30px}.el-popover .context-list[data-v-fcd31cd8]:last-child{margin-top:4px;width:100%;display:flex;justify-content:space-between}.el-popover .header-input[data-v-fcd31cd8]{margin-top:5px}.el-popover .filter-icon[data-v-fcd31cd8]{outline:none;width:15px;height:15px;cursor:pointer}