@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,389 +0,0 @@
1
- <template>
2
- <div v-show="visible" v-clickoutside="handleClickOut" class="plan-content">
3
- <!--
4
- 方案详情,包含名称,过滤条件
5
- -->
6
- <div class="plan-details">
7
- <div class="plan-title">
8
- <span class="title">方案名称:</span>
9
- <el-input v-model="planContent.name" size="mini" />
10
- <span class="error">{{ errorMsg }}</span>
11
- </div>
12
-
13
- <!-- 常用条件 -->
14
- <div class="condition-always">
15
- <span class="title">常用条件</span>
16
- <el-scrollbar>
17
- <ConditionAlwaysItem
18
- v-for="item in planContent.schemeUsefulList"
19
- :key="item.field"
20
- v-model="item.values"
21
- :data="item"
22
- />
23
- </el-scrollbar>
24
- </div>
25
-
26
- <!--高级过滤条件 -->
27
- <div class="plan-conditions">
28
- <span class="title">高级查询</span>
29
- <div>
30
- <ConditionItem
31
- v-for="condition in planContent.contentsList"
32
- :key="condition.id"
33
- :condition="condition"
34
- @remove="removeCondition(condition)"
35
- />
36
- </div>
37
-
38
- <div class="add-button" @click="addCondition">
39
- <i class="el-icon-plus" />
40
- <span>添加</span>
41
- </div>
42
- </div>
43
- </div>
44
-
45
- <!--
46
- 方案操作
47
- -->
48
- <div class="plan-buttons">
49
- <div class="buttons">
50
- <el-button type="primary" size="mini" @click="conditionChange">查询</el-button>
51
- <el-button type="primary" size="mini" @click="update($event)">保存</el-button>
52
- <el-button type="primary" size="mini" @click="add">保存为新方案</el-button>
53
- <el-button type="primary" size="mini" :disabled="planContent.isDefault" @click="update($event,true)">保存为默认</el-button>
54
- <el-button type="primary" size="mini" @click="deletePlan">删除方案</el-button>
55
- </div>
56
- </div>
57
- </div>
58
- </template>
59
- <script>
60
- import { getAllOverOperatorList } from '../js/operatorEnum'
61
- import Clickoutside from 'element-ui/src/utils/clickoutside'
62
- import ConditionItem from './condition-mult-item.vue'
63
- import ConditionAlwaysItem from './condition-always-item.vue'
64
- import { addPlan, deletePlan, updatePlan } from '@/api/tableV3.js'
65
- export default {
66
- components: {
67
- ConditionItem,
68
- ConditionAlwaysItem
69
- },
70
- directives: { Clickoutside },
71
- props: {
72
- visible: {
73
- type: Boolean,
74
- default: false
75
- },
76
- // 方案详情的内容
77
- content: {
78
- type: Object,
79
- default: null
80
- },
81
- // 当前所有方案的名称
82
- planNames: {
83
- type: Array,
84
- default: null
85
- }
86
- },
87
- data () {
88
- return {
89
- errorMsg: '',
90
- planContent: {
91
- name: '',
92
- schemeUsefulList: [],
93
- contentsList: []
94
- }
95
- }
96
- },
97
- inject: ['target'],
98
- watch: {
99
- content (newValue) {
100
- this.loadPlanContent(newValue)
101
- }
102
- },
103
- methods: {
104
- // 加载一个方案数据,处理方案的数据,并发射条件变更事件
105
- loadPlanContent (content, immediate = false) {
106
- const contentCopy = JSON.parse(JSON.stringify(content))
107
- contentCopy.contentsList = contentCopy.contentsList || []
108
- for (const alwaysItem of contentCopy.schemeUsefulList) {
109
- if (!alwaysItem.values.length) {
110
- alwaysItem.values.push('-1')
111
- }
112
- }
113
- this.planContent = contentCopy
114
- this.conditionChange()
115
- },
116
- // 点击方案内容外侧收起方案详情弹窗
117
- handleClickOut () {
118
- if (!this.visible) return
119
- this.$emit('update:visible', false)
120
- },
121
- /**
122
- * 添加一个高级过滤条件
123
- */
124
- addCondition () {
125
- const conditionModel = {
126
- id: Math.random().toString(36).slice(8),
127
- leftBracket: '(',
128
- field: '',
129
- operator: '',
130
- value: '',
131
- rightBracket: ')',
132
- relation: 'AND',
133
- fieldType: '',
134
- userSchemeId: this.content.id
135
- }
136
- this.planContent.contentsList.push(conditionModel)
137
- },
138
-
139
- /**
140
- * 删除一个高级过滤条件
141
- */
142
- removeCondition (condition) {
143
- const index = this.planContent.contentsList.indexOf(condition)
144
- this.planContent.contentsList.splice(index, 1)
145
- },
146
-
147
- /**
148
- * 条件前端校验
149
- * 校验含有空值,以及括号是否闭合
150
- */
151
- conditionValidate () {
152
- const bracketStack = []
153
- for (const condition of this.planContent.contentsList) {
154
- if (!getAllOverOperatorList().includes(condition.operator) && !condition.value) {
155
- this.$message.error('方案中存在没有填写内容的条件')
156
- return false
157
- }
158
-
159
- bracketStack.push(...condition.leftBracket.split(''))
160
- for (let i = 0; i < condition.rightBracket.length; i++) {
161
- if (!bracketStack.pop()) {
162
- this.$message.error('方案中条件的括号没有闭合')
163
- return false
164
- }
165
- }
166
- }
167
-
168
- if (bracketStack.length) {
169
- this.$message.error('方案中条件的括号没有闭合')
170
- return false
171
- }
172
-
173
- return true
174
- },
175
-
176
- /**
177
- * 搜索按钮的处理函数
178
- * 条件已经变更,将变更后的条件发射出去,父组件接受处理后使用新的条件调用接口查询数据
179
- */
180
- conditionChange () {
181
- if (!this.conditionValidate()) {
182
- return
183
- }
184
-
185
- // 常用条件格式化
186
- const conditionAlways = []
187
- for (const conditionAlwaysItem of this.planContent.schemeUsefulList) {
188
- conditionAlways.push({
189
- field: conditionAlwaysItem.field,
190
- values: conditionAlwaysItem.values
191
- })
192
- }
193
-
194
- // 高级过滤条件格式化
195
- const conditionMulti = []
196
- const getQueryMultiConditonItem = function (sourceMultiItem, index) {
197
- const keys = [
198
- 'leftBracket',
199
- 'field',
200
- 'operator',
201
- 'value',
202
- 'rightBracket',
203
- 'relation',
204
- 'fieldType'
205
- ]
206
- const res = {}
207
- res.sort = index
208
- for (const key of keys) {
209
- res[key] = sourceMultiItem[key]
210
- }
211
- return res
212
- }
213
-
214
- this.planContent.contentsList.forEach((item, index) => {
215
- conditionMulti.push(getQueryMultiConditonItem(item, index))
216
- })
217
- this.$emit('update:visible', false)
218
- this.$emit('change', { conditionAlways, conditionMulti })
219
- },
220
-
221
- /**
222
- * 方案增改接口数据格式处理
223
- * 新增和修改方案的接口数据格式一致,统一将页面数据格式化
224
- */
225
- paramDataFormat (type, setDefault) {
226
- // 处理方案信息
227
- const planMsg = {
228
- name: this.planContent.name,
229
- isDefault: false
230
- }
231
- if (type === 'update') {
232
- planMsg.id = this.planContent.id
233
- planMsg.isDefault = typeof setDefault === 'undefined'
234
- ? this.planContent.isDefault
235
- : setDefault
236
- }
237
-
238
- // 处理常用条件的结果
239
- const alwaysConditionData = []
240
- for (const alwaysItem of this.planContent.schemeUsefulList) {
241
- alwaysConditionData.push({
242
- field: alwaysItem.field,
243
- values: alwaysItem.values
244
- })
245
- }
246
- // 添加高级过滤条件的sort属性
247
- const multiConditionData = JSON.parse(JSON.stringify(this.planContent.contentsList))
248
- multiConditionData.forEach((item, index) => {
249
- item.sort = index
250
- item.id = null
251
- })
252
-
253
- return {
254
- planMsg,
255
- conditionAlways: alwaysConditionData,
256
- conditionMulti: multiConditionData
257
- }
258
- },
259
-
260
- /**
261
- * 保存按钮和设置为默认方案按钮的处理函数
262
- * 方案的修改,和修改为默认方案
263
- */
264
- async update (event, setDefault) {
265
- if (this.planContent.id === '0') {
266
- return this.$message.error('缺省方案不能被修改,可以尝试保存为新方案')
267
- }
268
- if (this.planNames.filter(name => name !== this.planContent.name).includes(this.planContent.name)) {
269
- return this.$message.error('该名称已经被其他方案占用')
270
- }
271
- if (!this.conditionValidate()) {
272
- return
273
- }
274
- const res = await updatePlan(this.target, this.paramDataFormat('update', setDefault))
275
- if (res.code !== 0) {
276
- return this.$message.error(res.msg)
277
- }
278
- this.$message.success('修改成功')
279
- this.$emit('listChange', this.planContent.id)
280
- },
281
-
282
- /**
283
- * 保存为新方案的按钮处理函数
284
- * 添加一个新的方案
285
- */
286
- async add () {
287
- if (this.planNames.includes(this.planContent.name)) {
288
- return this.$message.error('该方案名称已经存在')
289
- }
290
- if (!this.conditionValidate()) {
291
- return
292
- }
293
- const res = await addPlan(this.target, this.paramDataFormat('insert'))
294
- if (res.code !== 0) {
295
- return this.$message.error(res.msg)
296
- }
297
- this.$message.success('保存成功')
298
- this.$emit('listChange', res.data)
299
- },
300
-
301
- /**
302
- * 删除当前方案
303
- */
304
- async deletePlan () {
305
- if (this.planContent.id === '0') {
306
- return this.$message.error('缺省方案不允许删除')
307
- }
308
- const res = await deletePlan(this.target, this.planContent.id)
309
- if (res.code !== 0) {
310
- return this.$message.error(res.msg)
311
- }
312
- this.$message.success('删除成功')
313
- this.$emit('listChange')
314
- }
315
- }
316
- }
317
- </script>
318
-
319
- <style scoped lang='less'>
320
- .title {
321
- font-size:18px;
322
- }
323
- .plan-content {
324
- position:absolute;
325
- top:24px;
326
- width:900px;
327
- display:flex;
328
- background-color: #fff;
329
- z-index:9;
330
- box-shadow: 5px 5px 10px 3px rgba(0, 0, 0, 0.2);
331
-
332
- // 左侧的方案详情
333
- .plan-details {
334
- padding:20px;
335
- flex:6;
336
- // background-color: #f6f7f9;
337
- background-color: #fff;
338
- // .condition-always {
339
- // margin-top:15px;
340
- // }
341
-
342
- .condition-always {
343
- margin-top:30px;
344
- /deep/.el-scrollbar{
345
- height: 20vh;
346
- .el-scrollbar__wrap{
347
- overflow-x: hidden;
348
- }
349
- }
350
- }
351
-
352
- .plan-conditions {
353
- .add-button {
354
- cursor:pointer;
355
- user-select: none;
356
- width:50px;
357
- // border:1px solid black;
358
- span {
359
- margin-left:3px;
360
- }
361
- span:hover {
362
- color:#0a5295;
363
- }
364
- }
365
- }
366
- }
367
-
368
- // 右侧的操作按钮组
369
- .plan-buttons {
370
- border-left:1px solid #dddfe6;
371
- flex:2;
372
-
373
- .buttons{
374
- height:300px;
375
- display:flex;
376
- flex-direction:column;
377
- .el-button {
378
- margin:10px 40px;
379
- background-color: #055A9D;
380
- border:none;
381
- }
382
- .is-disabled {
383
- background-color: #357bc2;
384
- }
385
- }
386
- }
387
- }
388
-
389
- </style>
@@ -1,129 +0,0 @@
1
- <template>
2
- <div class="t-table">
3
- <!-- 表格分组 -->
4
- <div v-if="enableGroup" class="t-table-left">
5
- <TableGroup @groupChange="$emit('groupChange', $event)" />
6
- </div>
7
-
8
- <!-- 表格记录 -->
9
- <div class="t-table-right">
10
- <TableRecords
11
- ref="tableRecordsRef"
12
- :layout="layout"
13
- :is-selector="isSelector"
14
- :sum="sum"
15
- :enable-sum="enableSum"
16
- :data="data"
17
- :update-in-dialog="updateInDialog"
18
- :page-size="pageSize"
19
- :current-page="currentPage"
20
- @size-change="$emit('size-change', $event)"
21
- @current-change="$emit('current-change', $event)"
22
- @condition-change="$emit('condition-change', $event)"
23
- @dbClick="$emit('dbClick', $event)"
24
- @dbRowClick="$emit('dbRowClick',$event)"
25
- @fastConfirm="$emit('fastConfirm',$event)"
26
- />
27
- </div>
28
-
29
- </div>
30
- </template>
31
- <script>
32
- import TableGroup from './table-group.vue'
33
- import TableRecords from './table-records.vue'
34
- export default {
35
- components: {
36
- TableGroup, TableRecords
37
- },
38
- props: {
39
- // 表格的布局
40
- layout: {
41
- type: Array,
42
- default: null
43
- },
44
- enableGroup: {
45
- type: Boolean,
46
- default: false
47
- },
48
- // 分组是否可以编辑,再基础资料的弹窗中,分组不可以被编辑
49
- enableGroupEdit: {
50
- type: Boolean,
51
- default: false
52
- },
53
- /**
54
- * 是否是选择器(弹窗)
55
- */
56
- isSelector: {
57
- type: Boolean,
58
- default: false
59
- },
60
- // 表格的合计
61
- sum: {
62
- type: Array,
63
- default: () => []
64
- },
65
- // 表格的数据,包含了records属性和total属性
66
- data: {
67
- type: Object,
68
- default: null
69
- },
70
- pageSize: {
71
- type: Number,
72
- default: 100
73
- },
74
- currentPage: {
75
- type: Number,
76
- default: 1
77
- },
78
- updateInDialog: {
79
- type: Boolean,
80
- default: false
81
- },
82
- enableSum: {
83
- type: Boolean,
84
- default: false
85
- }
86
- },
87
- data () {
88
- return {
89
-
90
- }
91
- },
92
- created () {
93
- this.$on('headConditionClear', () => {
94
- this.$refs.tableRecordsRef.initTableFilterData()
95
- })
96
- },
97
- beforeDestroy () {
98
- this.$off('headConditionClear')
99
- },
100
- provide () {
101
- return {
102
- enableGroupEdit: this.enableGroupEdit
103
- }
104
- }
105
- }
106
- </script>
107
-
108
- <style scoped lang='less'>
109
- .t-table {
110
- height:100%;
111
- display: flex;
112
-
113
- .t-table-left{
114
- width:300px;
115
- // min-width: 290px;
116
- height: 100%;
117
- .table-group{
118
- height: 100%;
119
- }
120
- }
121
-
122
- .t-table-right{
123
- flex: 1;
124
- // width:100%;
125
- min-width: 500px;
126
- }
127
- }
128
-
129
- </style>