@tongfun/tf-widget 0.1.29 → 0.1.30

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 (81) hide show
  1. package/README.md +4 -0
  2. package/lib/tf-widget.common.js +264 -226
  3. package/lib/tf-widget.css +1 -1
  4. package/lib/tf-widget.umd.js +264 -226
  5. package/lib/tf-widget.umd.min.js +4 -4
  6. package/package.json +1 -1
  7. package/package/svg-icon/index.js +0 -8
  8. package/package/svg-icon/src/SvgIcon.vue +0 -59
  9. package/package/t-data-list/index.js +0 -6
  10. package/package/t-data-list/main.vue +0 -193
  11. package/package/t-data-list/src/condition-input/basic.vue +0 -31
  12. package/package/t-data-list/src/condition-input/date.vue +0 -106
  13. package/package/t-data-list/src/condition-input/index.vue +0 -100
  14. package/package/t-data-list/src/condition-input/input.vue +0 -31
  15. package/package/t-data-list/src/condition-input/number.vue +0 -115
  16. package/package/t-data-list/src/condition-input/select.vue +0 -86
  17. package/package/t-data-list/src/js/fieldTypeEnum.js +0 -10
  18. package/package/t-data-list/src/js/operatorEnum.js +0 -108
  19. package/package/t-data-list/src/js/qureyParamsEnum.js +0 -4
  20. package/package/t-data-list/src/js/util.js +0 -34
  21. package/package/t-data-list/src/mixins/button-controll-mixin.js +0 -93
  22. package/package/t-data-list/src/pushdown/push-down.vue +0 -158
  23. package/package/t-data-list/src/t-list-search.vue +0 -36
  24. package/package/t-data-list/src/t-plan/condition-always-item.vue +0 -143
  25. package/package/t-data-list/src/t-plan/condition-mult-item.vue +0 -222
  26. package/package/t-data-list/src/t-plan/index.vue +0 -195
  27. package/package/t-data-list/src/t-plan/plan-content.vue +0 -389
  28. package/package/t-data-list/src/t-table/index.vue +0 -129
  29. package/package/t-data-list/src/t-table/table-group-item-edit.vue +0 -238
  30. package/package/t-data-list/src/t-table/table-group-item.vue +0 -87
  31. package/package/t-data-list/src/t-table/table-group.vue +0 -180
  32. package/package/t-data-list/src/t-table/table-records-header-popover.vue +0 -246
  33. package/package/t-data-list/src/t-table/table-records-selected.vue +0 -159
  34. package/package/t-data-list/src/t-table/table-records.vue +0 -336
  35. package/package/t-input/children/address.vue +0 -101
  36. package/package/t-input/children/basic-display.vue +0 -41
  37. package/package/t-input/children/basic.vue +0 -261
  38. package/package/t-input/children/date.vue +0 -84
  39. package/package/t-input/children/group-components/group-dialog.vue +0 -344
  40. package/package/t-input/children/group.vue +0 -126
  41. package/package/t-input/children/input.vue +0 -67
  42. package/package/t-input/children/number.vue +0 -71
  43. package/package/t-input/children/select.vue +0 -86
  44. package/package/t-input/children/tfile/fiile-enclosure.vue +0 -233
  45. package/package/t-input/children/tfile/file-img/comp.png +0 -0
  46. package/package/t-input/children/tfile/file-img/excel.png +0 -0
  47. package/package/t-input/children/tfile/file-img/img.png +0 -0
  48. package/package/t-input/children/tfile/file-img/pdf.png +0 -0
  49. package/package/t-input/children/tfile/file-img/word.png +0 -0
  50. package/package/t-input/index.js +0 -7
  51. package/package/t-input/index.vue +0 -337
  52. package/package/t-input/tInputCache.js +0 -24
  53. package/package/tf-icon-picker/README.md +0 -8
  54. package/package/tf-icon-picker/index.js +0 -8
  55. package/package/tf-icon-picker/src/tf-icon-picker.vue +0 -266
  56. package/package/tf-layout/README.md +0 -115
  57. package/package/tf-layout/index.js +0 -8
  58. package/package/tf-layout/src/components/tf-labelbar.vue +0 -394
  59. package/package/tf-layout/src/components/tf-menu.vue +0 -180
  60. package/package/tf-layout/src/components/tf-right-menu.vue +0 -89
  61. package/package/tf-layout/src/components/tf-rotate-box.vue +0 -50
  62. package/package/tf-layout/src/tf-layout.vue +0 -140
  63. package/package/tf-widget/index.js +0 -8
  64. package/package/tf-widget/src/assets/common-input.less +0 -11
  65. package/package/tf-widget/src/children/basic-data/basic-data.vue +0 -366
  66. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +0 -1087
  67. package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +0 -750
  68. package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +0 -519
  69. package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +0 -93
  70. package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +0 -240
  71. package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +0 -108
  72. package/package/tf-widget/src/children/date-time.vue +0 -103
  73. package/package/tf-widget/src/children/date.vue +0 -103
  74. package/package/tf-widget/src/children/decimal.vue +0 -115
  75. package/package/tf-widget/src/children/integer.vue +0 -104
  76. package/package/tf-widget/src/children/property.vue +0 -59
  77. package/package/tf-widget/src/children/single-line-text.vue +0 -82
  78. package/package/tf-widget/src/children/small-pictures.vue +0 -223
  79. package/package/tf-widget/src/children/text-area.vue +0 -74
  80. package/package/tf-widget/src/children/tf-select.vue +0 -113
  81. package/package/tf-widget/src/tf-widget.vue +0 -175
@@ -1,336 +0,0 @@
1
- <template>
2
- <div ref="tableRecords" class="table-records">
3
- <div class="table-wrapper">
4
- <ux-grid
5
- ref="dataRecordsRef"
6
- v-loading="syncData.tableLoading"
7
- :data="data.records"
8
- size="mini"
9
- column-key
10
- beautify-table
11
- :show-summary="showSummaryComp"
12
- :summary-method="summaryMethod"
13
- :width-resize="true"
14
- :highlight-current-row="false"
15
- show-overflow="tooltip"
16
- @row-click="handleRowClick"
17
- @select="handleSelect"
18
- @row-dblclick="handelRowDblClick"
19
- @select-all="selectAll"
20
- >
21
- <ux-table-column :width="50" type="checkbox" fixed="left" />
22
- <template v-for="(item,index) in layout">
23
- <ux-table-column
24
- v-if="item.visible"
25
- :key="item.field"
26
- :width="layout.length<8?'': '150'"
27
- align="center"
28
- resizable
29
- :title="item.title"
30
- :field="item.field"
31
- >
32
- <template v-slot:header="{ column }">
33
- <div class="filter-slot">
34
- <span class="title">{{ column.title }}</span>
35
- <TableRecordsHeaderPopover
36
- :class="{'my-popover':true,'is-show-filter-icon': !!item.isShowIcon || item.isShowFilter }"
37
- :item="item"
38
- :upload-data-map="uploadDataMap"
39
- :table-filter-data="tableFilterData"
40
- @condition-change="$emit('condition-change', $event)"
41
- @filter-click="filterClick($event,index)"
42
- />
43
- </div>
44
- </template>
45
- </ux-table-column>
46
- </template>
47
- </ux-grid>
48
- <TableRecordsSelected
49
- v-if="isSelector"
50
- :select-data="selectedRows"
51
- :show-field="syncData.displayField"
52
- @del="handleDel"
53
- @clear="handleClearSelected"
54
- />
55
- </div>
56
-
57
- <!-- 分页 -->
58
- <div class="page-wrapper">
59
- <el-pagination
60
- :current-page="currentPage"
61
- :page-sizes="[200, 500, 1000, 5000]"
62
- :page-size="pageSize"
63
- layout="total, sizes, prev, pager, next, jumper"
64
- :total="data.total"
65
- @size-change="$emit('size-change', $event)"
66
- @current-change="$emit('current-change', $event)"
67
- />
68
- </div>
69
-
70
- </div>
71
- </template>
72
- <script>
73
- import TableRecordsSelected from './table-records-selected'
74
- import TableRecordsHeaderPopover from './table-records-header-popover.vue'
75
- export default {
76
- components: {
77
- TableRecordsHeaderPopover,
78
- TableRecordsSelected
79
- },
80
- props: {
81
- data: {
82
- type: Object,
83
- default: null
84
- },
85
- isSelector: {
86
- type: Boolean,
87
- default: false
88
- },
89
- layout: {
90
- type: Array,
91
- default: () => {
92
- return []
93
- }
94
- },
95
- sum: {
96
- type: Array,
97
- default: () => []
98
- },
99
- pageSize: {
100
- type: Number,
101
- default: 100
102
- },
103
- currentPage: {
104
- type: Number,
105
- default: 1
106
- },
107
- updateInDialog: {
108
- type: Boolean,
109
- default: false
110
- },
111
- enableSum: {
112
- type: Boolean,
113
- default: false
114
- }
115
- },
116
- inject: ['selectedRows', 'ids', 'syncData', 'getDbRow', 'showSummary', 'queryType'],
117
- data () {
118
- return {
119
- tableFilterData: {}, // 表头过滤条件的数据的存储集合
120
- uploadDataMap: {}, // 真实向上发送的数据集合
121
- idField: null,
122
- filterSelectedId: '',
123
- isSingleFilter: true,
124
- displayField: ''
125
- }
126
- },
127
- computed: {
128
- showSummaryComp () {
129
- return this.queryType === 'LIST'
130
- }
131
- },
132
- watch: {
133
- layout: {
134
- handler (newVal) {
135
- if (Object.keys(this.tableFilterData).length !== 0) {
136
- return
137
- }
138
- this.initTableFilterData()
139
- // newVal.length > 0 && newVal.forEach(e => {
140
- // if (e.isId) this.idField = e.field
141
- // this.$set(this.tableFilterData, e.field, { field: e.field, operator: '', value: '', fieldType: e.componentType })
142
- // })
143
- },
144
- immediate: true
145
- },
146
- 'data.records': {
147
- handler (newValue) {
148
- /**
149
- * 在列表的情况下,只有提交审核等几个有限的操作,数据刷新不清空已选
150
- */
151
- if (this.queryType === 'LIST' && this.syncData.tableSelectionClear) {
152
- return this.clearSelectedRows()
153
- }
154
- this.syncData.tableSelectionClear = true
155
-
156
- /**
157
- * 在弹窗的所有情况和列表特殊情况(提交/审核后重新获取数据)
158
- * 数据刷新后,重新勾选之前已经选择的数据
159
- */
160
- const xidList = this.selectedRows.map(item => item.Sid)
161
- if (!xidList[0]) {
162
- return
163
- }
164
- const currentSelectRows = newValue.filter(item => {
165
- if (xidList.indexOf(item.Sid) > -1) {
166
- this.selectedRows[xidList.indexOf(item.Sid)] = item
167
- return true
168
- }
169
- return false
170
- })
171
- const params = currentSelectRows.map(x => {
172
- return { row: x, selected: true }
173
- })
174
- this.$refs.dataRecordsRef.toggleRowSelection(params)
175
- }
176
- }
177
- },
178
- methods: {
179
- /**
180
- * 表头过滤
181
- */
182
- // 初始化或清空表头过滤的缓存容器
183
- initTableFilterData () {
184
- this.layout.length && this.layout.forEach(e => {
185
- if (e.isId) this.idField = e.field
186
- this.$set(this.tableFilterData, e.field, { field: e.field, operator: '', value: '', fieldType: e.componentType })
187
- this.$set(e, 'isShowIcon', false)
188
- })
189
- },
190
- // 表头过滤触发了过滤事件
191
- filterClick (value, index) {
192
- if (!this.isSingleFilter) {
193
- return
194
- }
195
- // 重置其他页面的表头过滤显示状态
196
- if (!value && this.filterSelectedId) {
197
- this.layout[this.filterSelectedId].isShowFilter = false
198
- }
199
- this.filterSelectedId = index
200
- },
201
- handleClearSelected () {
202
- this.$refs.dataRecordsRef.clearSelection()
203
- this.clearSelectedRows()
204
- },
205
- // 清空已选
206
- clearSelectedRows () {
207
- this.selectedRows.splice(0, this.selectedRows.length)
208
- this.ids.splice(0, this.ids.length)
209
- },
210
- // 列表合计
211
- summaryMethod () {
212
- return [this.sum]
213
- },
214
- handleDel (item) {
215
- this.selectedRows.splice(this.selectedRows.indexOf(item), 1)
216
- this.ids.splice(this.ids.indexOf(item.id), 1)
217
- this.$refs.dataRecordsRef.toggleRowSelection([{ row: item, selected: false }])
218
- },
219
- handleRowClick (row) {
220
- this.$refs.dataRecordsRef.toggleRowSelection([{ row }])
221
- if (!this.ids.includes(row[this.idField])) {
222
- this.selectedRows.push(row)
223
- this.ids.push(row[this.idField])
224
- } else {
225
- this.selectedRows.splice(this.selectedRows.indexOf(row), 1)
226
- this.ids.splice(this.ids.indexOf(row[this.idField]), 1)
227
- }
228
- },
229
- handelRowDblClick (row) {
230
- // todo:这里判断条件太多,并且条件之间有优先级,将来条件可能冲突
231
- if (this.isSelector) {
232
- return this.$emit('fastConfirm', row)
233
- }
234
- if (this.updateInDialog) {
235
- return this.$emit('dbClick', row[this.idField])
236
- }
237
- if (this.getDbRow) {
238
- return this.$emit('dbRowClick', row)
239
- }
240
-
241
- const randomStr = Math.random().toString(36).slice(8)
242
- this.$router.replace(`${this.$route.path}/update/${randomStr}/${row[this.idField]}`)
243
- },
244
- selectAll (selection) {
245
- if (selection.length > 1) {
246
- // 是全选的处理方式
247
- const needAddData = this.data.records.filter(e => !this.selectedRows.includes(e))
248
- needAddData.forEach(e => {
249
- this.selectedRows.push(e)
250
- this.ids.push(e[this.idField])
251
- })
252
- } else {
253
- // 非全选的处理方式
254
- const selectedRowsCache = this.selectedRows.filter(e => !this.data.records.includes(e))
255
- this.selectedRows.splice(0, this.selectedRows.length)
256
- this.ids.splice(0, this.ids.length)
257
- this.selectedRows.push(...selectedRowsCache)
258
- this.ids.push(...selectedRowsCache.map(v => v[this.idField]))
259
- }
260
- },
261
-
262
- /**
263
- * 复选框被勾选
264
- */
265
- handleSelect (selection, row) {
266
- if (!this.ids.includes(row[this.idField])) {
267
- if (selection.includes(row)) {
268
- this.selectedRows.push(row)
269
- row[this.idField] && this.ids.push(row[this.idField])
270
- }
271
- } else {
272
- if (!selection.includes(row)) {
273
- this.selectedRows.splice(this.selectedRows.indexOf(row), 1)
274
- row[this.idField] && this.ids.splice(this.ids.indexOf(row[this.idField]), 1)
275
- }
276
- }
277
- }
278
-
279
- }
280
- }
281
- </script>
282
-
283
- <style scoped lang='less'>
284
- .table-records {
285
- height:90vh;
286
- .table-wrapper {
287
- overflow: hidden;
288
- display: flex;
289
- ::v-deep .plTableBox{
290
- .elx-table--body-wrapper{
291
- height: calc(90vh - 230px );//修改以适应合计行的添加,
292
- overflow-x:hidden;
293
- }
294
- .elx-table:not(.is--empty).show--foot.scroll--x .elx-table--body-wrapper{
295
- overflow-x: hidden !important;
296
- }
297
- .elx-table--footer-wrapper{
298
- margin-top: 0px!important;
299
- }
300
- .elx-header--column{
301
- color: #085497;
302
- transition: opacity 0.5s ease-in;
303
- .filter-slot{
304
- display: flex;
305
- align-items: center;
306
- justify-content: center;
307
- }
308
- .my-popover{
309
- opacity: 0;
310
- width: 0;
311
- cursor: pointer;
312
- transition: all 0.5s ease-out;
313
- }
314
- :hover .my-popover{
315
- width:15px;
316
- opacity: 1;
317
- transition: opacity 0.5s ease-in;
318
- }
319
- .is-show-filter-icon{
320
- width:15px;
321
- opacity: 1;
322
- }
323
-
324
- }
325
- }
326
- }
327
- .page-wrapper {
328
- margin-top:5px;
329
- position:relative;
330
- .el-pagination {
331
- position:absolute;
332
- right:0;
333
- }
334
- }
335
- }
336
- </style>
@@ -1,101 +0,0 @@
1
- <template>
2
- <div>
3
- <!-- 分组输入框 -->
4
- <div class="address">
5
- <el-cascader
6
- :value="value"
7
- :options="options"
8
- placeholder="选择地址"
9
- popper-class="t-input-cascader-box"
10
- separator=""
11
- :props="{
12
- value:'name',
13
- label:'name',
14
- children:'districts',
15
- leaf:'leaf',
16
- lazy:'true',
17
- lazyLoad:lazyLoad,
18
- checkStrictly: true
19
- }"
20
- filterable
21
- @input="handleInput"
22
- />
23
- </div>
24
- </div>
25
- </template>
26
-
27
- <script>
28
-
29
- import axios from 'axios'
30
- import TInputCache from '../tInputCache'
31
-
32
- export default {
33
- name: 'Address',
34
- props: {
35
- value: {
36
- type: [String, Object],
37
- default: null
38
- }
39
- },
40
- data () {
41
- return {
42
- options: []
43
- }
44
- },
45
- mounted () {
46
- this.getAddress()
47
- },
48
- methods: {
49
- lazyLoad (node, resolve) {
50
- const { data } = node
51
- resolve(data)
52
- },
53
- async getAddress () {
54
- const tInputDataCache = new TInputCache()
55
- console.log(tInputDataCache.getCacheData('address'))
56
- if (tInputDataCache.getCacheData('address')) {
57
- this.options = tInputDataCache.getCacheData('address')
58
- return
59
- }
60
- // 这边的接口用的自己的key,后期可能会换
61
- const res = await axios.get('https://restapi.amap.com/v3/config/district?subdistrict=3&key=7f3a1929b7016033782ef2aace13c449')
62
- if (!res.data) {
63
- this.$message.error('未查询到数据')
64
- return
65
- }
66
- const optionData = this.setLeaf(res.data.districts[0].districts)
67
- this.options = optionData
68
- tInputDataCache.setCacheData('address', optionData)
69
- },
70
- setLeaf (data) {
71
- if (!data || data.length === 0) {
72
- return
73
- }
74
- console.log(data)
75
- data.forEach(e => {
76
- e.leaf = true
77
- if (e.districts.length > 0) {
78
- e.leaf = false
79
- this.setLeaf(e.districts)
80
- }
81
- })
82
- return data
83
- },
84
- handleInput (value) {
85
- console.log(value.join(''))
86
- }
87
- }
88
- }
89
- </script>
90
- <style lang="less">
91
- // 更改地址组组件的样式
92
- .t-input-cascader-box{
93
- .el-cascader-panel{
94
- height: 400px;
95
- ul{
96
- height: 400px;
97
- }
98
- }
99
- }
100
-
101
- </style>
@@ -1,41 +0,0 @@
1
- <template>
2
- <el-input disabled :value="displayName" suffix-icon="el-icon-search" />
3
- </template>
4
- <script>
5
- export default {
6
- components: {
7
- },
8
- props: {
9
- value: {
10
- type: Object,
11
- default: function () {
12
- return { name: null, id: null }
13
- }
14
- }
15
- },
16
- data () {
17
- return {
18
-
19
- }
20
- },
21
- computed: {
22
- displayName () {
23
- return this.value.name
24
- }
25
- },
26
- created () {
27
- if (!this.value) {
28
- this.hanleInput({ name: null, id: null })
29
- }
30
- },
31
- methods: {
32
- hanleInput (value) {
33
- this.$emit('input', value)
34
- }
35
- }
36
- }
37
- </script>
38
-
39
- <style scoped>
40
-
41
- </style>