@tongfun/tf-widget 0.1.24 → 0.1.27

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 (95) hide show
  1. package/README.md +77 -54
  2. package/lib/tf-widget.common.js +624 -618
  3. package/lib/tf-widget.css +1 -1
  4. package/lib/tf-widget.umd.js +624 -618
  5. package/lib/tf-widget.umd.min.js +4 -4
  6. package/package/svg-icon/index.js +8 -8
  7. package/package/svg-icon/src/SvgIcon.vue +59 -59
  8. package/package/t-data-list/index.js +6 -6
  9. package/package/t-data-list/main.vue +193 -193
  10. package/package/t-data-list/src/condition-input/basic.vue +31 -31
  11. package/package/t-data-list/src/condition-input/date.vue +106 -106
  12. package/package/t-data-list/src/condition-input/index.vue +100 -100
  13. package/package/t-data-list/src/condition-input/input.vue +31 -31
  14. package/package/t-data-list/src/condition-input/number.vue +115 -115
  15. package/package/t-data-list/src/condition-input/select.vue +86 -86
  16. package/package/t-data-list/src/js/fieldTypeEnum.js +10 -10
  17. package/package/t-data-list/src/js/operatorEnum.js +108 -108
  18. package/package/t-data-list/src/js/qureyParamsEnum.js +4 -4
  19. package/package/t-data-list/src/js/util.js +34 -34
  20. package/package/t-data-list/src/mixins/button-controll-mixin.js +93 -93
  21. package/package/t-data-list/src/pushdown/push-down.vue +158 -158
  22. package/package/t-data-list/src/t-list-search.vue +36 -36
  23. package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -143
  24. package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -222
  25. package/package/t-data-list/src/t-plan/index.vue +195 -195
  26. package/package/t-data-list/src/t-plan/plan-content.vue +389 -389
  27. package/package/t-data-list/src/t-table/index.vue +129 -129
  28. package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -238
  29. package/package/t-data-list/src/t-table/table-group-item.vue +87 -87
  30. package/package/t-data-list/src/t-table/table-group.vue +180 -180
  31. package/package/t-data-list/src/t-table/table-records-header-popover.vue +246 -246
  32. package/package/t-data-list/src/t-table/table-records-selected.vue +159 -159
  33. package/package/t-data-list/src/t-table/table-records.vue +336 -336
  34. package/package/t-input/children/address.vue +101 -101
  35. package/package/t-input/children/basic-display.vue +41 -41
  36. package/package/t-input/children/basic.vue +261 -254
  37. package/package/t-input/children/date.vue +84 -89
  38. package/package/t-input/children/group-components/group-dialog.vue +344 -344
  39. package/package/t-input/children/group.vue +126 -126
  40. package/package/t-input/children/input.vue +67 -72
  41. package/package/t-input/children/number.vue +71 -74
  42. package/package/t-input/children/select.vue +86 -89
  43. package/package/t-input/children/tfile/fiile-enclosure.vue +233 -233
  44. package/package/t-input/index.js +7 -7
  45. package/package/t-input/index.vue +337 -337
  46. package/package/t-input/tInputCache.js +24 -24
  47. package/package/tf-icon-picker/README.md +7 -7
  48. package/package/tf-icon-picker/index.js +8 -8
  49. package/package/tf-icon-picker/src/tf-icon-picker.vue +266 -266
  50. package/package/tf-layout/README.md +115 -115
  51. package/package/tf-layout/index.js +8 -8
  52. package/package/tf-layout/src/components/tf-labelbar.vue +394 -394
  53. package/package/tf-layout/src/components/tf-menu.vue +180 -180
  54. package/package/tf-layout/src/components/tf-right-menu.vue +89 -89
  55. package/package/tf-layout/src/components/tf-rotate-box.vue +50 -50
  56. package/package/tf-layout/src/tf-layout.vue +140 -140
  57. package/package/tf-widget/index.js +8 -8
  58. package/package/tf-widget/src/assets/common-input.less +10 -10
  59. package/package/tf-widget/src/children/basic-data/basic-data.vue +361 -361
  60. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +1087 -1087
  61. package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +750 -750
  62. package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +519 -519
  63. package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +93 -93
  64. package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +240 -240
  65. package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +108 -108
  66. package/package/tf-widget/src/children/date-time.vue +103 -103
  67. package/package/tf-widget/src/children/date.vue +103 -103
  68. package/package/tf-widget/src/children/decimal.vue +115 -115
  69. package/package/tf-widget/src/children/integer.vue +104 -104
  70. package/package/tf-widget/src/children/property.vue +59 -59
  71. package/package/tf-widget/src/children/single-line-text.vue +82 -82
  72. package/package/tf-widget/src/children/small-pictures.vue +223 -223
  73. package/package/tf-widget/src/children/text-area.vue +74 -74
  74. package/package/tf-widget/src/children/tf-select.vue +113 -113
  75. package/package/tf-widget/src/tf-widget.vue +175 -175
  76. package/package.json +44 -44
  77. package/postinstall.js +1 -1
  78. package/src/api/edit.js +97 -97
  79. package/src/api/file-enclosure.js +26 -26
  80. package/src/api/push-down.js +19 -19
  81. package/src/api/table.js +294 -294
  82. package/src/api/tableV3.js +166 -166
  83. package/src/assets/images/icons/index.js +9 -9
  84. package/src/assets/images/icons/svg/add.svg +5 -5
  85. package/src/assets/images/icons/svg/push-down.svg +1 -1
  86. package/src/assets/images/icons/svg/remove.svg +1 -1
  87. package/src/assets/styles/common-table.less +202 -202
  88. package/src/directives/debounce.js +24 -24
  89. package/src/index.js +31 -31
  90. package/src/mixins/t-data-query-mixin.js +293 -290
  91. package/src/utils/auth.js +22 -22
  92. package/src/utils/request.js +42 -42
  93. package/src/utils/stato-anormale.js +59 -59
  94. package/src/utils/utils.js +109 -109
  95. package/src/utils/validate.js +84 -84
@@ -1,254 +1,261 @@
1
- <template>
2
- <div class="basic-input">
3
- <!-- 输入控件 -->
4
- <el-autocomplete
5
- ref="basic"
6
- v-model="displayValue"
7
- placeholder=""
8
- :fetch-suggestions="getAdvice"
9
- :disabled="disabled"
10
- popper-class="basic-suggest-poper"
11
- :trigger-on-focus="false"
12
- @select="handleSelect"
13
- @keydown.delete.native="handleDeleteKeyDown"
14
- >
15
- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="showDialog" />
16
- <template slot-scope="{item}">
17
- <div>{{ suggestDisplay(item) }}</div>
18
- </template>
19
- </el-autocomplete>
20
-
21
- <!-- 弹窗数据选择器 -->
22
- <el-dialog
23
- :visible.sync="dialogVisible"
24
- width="80%"
25
- :append-to-body="appendToBody"
26
- :close-on-click-modal="false"
27
- :close-on-press-escape="false"
28
- :modal-append-to-body="modalAppendToBody"
29
- @open="getTableData"
30
- >
31
- <!-- {{ limitation }} -->
32
- <div class="dataDialog">
33
- <Ttable
34
- class="t-table"
35
- is-selector
36
- :layout="tableLayout"
37
- :sum="tableSum"
38
- :data="tableData"
39
- enable-group
40
- :page-size="query.pageSize"
41
- :current-page="query.pageNum"
42
- update-in-dialog
43
- @condition-change="handleHeadChange"
44
- @groupChange="handleGroupChange"
45
- @size-change="handleSizeChange"
46
- @current-change="handleCurrentChange"
47
- @fastConfirm="handleFastSelect"
48
- />
49
- </div>
50
- <template v-slot:title>
51
- <div class="common-title">
52
- <TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,true)" />
53
- </div>
54
- </template>
55
- <span slot="footer" class="dialog-footer basic-selector-footer">
56
- <el-button class="common-header-button close" size="mini" type="primary" @click="dialogVisible = false">取 消</el-button>
57
- <el-button class="common-header-button" size="mini" type="primary" @click="handleDialogConfirm">确 定</el-button>
58
- </span>
59
- </el-dialog>
60
- </div>
61
- </template>
62
- <script>
63
- import TListSearch from '../../t-data-list/src/t-list-search.vue'
64
- import Ttable from '../../t-data-list/src/t-table/index'
65
- import dataQuery from '../../../src/mixins/t-data-query-mixin.js'
66
- export default {
67
- components: {
68
- TListSearch,
69
- Ttable
70
- },
71
- mixins: [dataQuery],
72
- props: {
73
- value: {
74
- type: Object,
75
- default: () => {
76
- return { name: '', id: null }
77
- }
78
- },
79
- limitation: {
80
- type: Object,
81
- default: () => { }
82
- },
83
- disabled: {
84
- type: Boolean,
85
- default: false
86
- },
87
- appendToBody: {
88
- type: Boolean,
89
- default: true
90
- },
91
- modalAppendToBody: {
92
- type: Boolean,
93
- default: false
94
- }
95
- },
96
- inject: ['target', 'entity'],
97
- data () {
98
- return {
99
- dialogVisible: false,
100
- // 选中一个基础资料之后,基础资料控件显示的名称
101
- displayField: null,
102
- queryType: 'SELECTOR'
103
- }
104
- },
105
- computed: {
106
- displayValue: {
107
- set (value) {
108
- if (this.value.id) {
109
- return
110
- }
111
- this.value.name = value
112
- },
113
- get () {
114
- if (!this.value) {
115
- return
116
- }
117
- return this.value.name
118
- }
119
- }
120
- },
121
- created () {
122
- if (this.entity) {
123
- this.$nextTick(() => {
124
- this.$refs.basic.focus()
125
- })
126
- }
127
- // this.getTableLayout()
128
- },
129
- methods: {
130
- /**
131
- * 弹窗和数据选择
132
- */
133
- // 展开弹窗
134
- async showDialog () {
135
- if (this.disabled) {
136
- return
137
- }
138
- this.dialogVisible = true
139
- this.tableLayout.length === 0 && (await this.getTableLayout())
140
- },
141
- // 点击弹窗确定按钮
142
- handleDialogConfirm () {
143
- if (!this.ids.length) {
144
- this.dialogVisible = false
145
- return
146
- }
147
-
148
- if (!this.entity && this.ids.length > 1) {
149
- return this.$message.error('单据头中只能选择一条数据')
150
- }
151
-
152
- if (!this.entity) {
153
- const name = this.selectedRows[0][this.displayField]
154
- const id = this.ids[0]
155
- this.$emit('input', { name, id })
156
- this.$emit('selected', this.selectedRows)
157
- } else {
158
- this.$emit('selected', this.selectedRows)
159
- }
160
- this.dialogVisible = false
161
- },
162
- // 双击选择数据
163
- handleFastSelect (row) {
164
- this.$emit('input', { name: row[this.displayField], id: row[this.idField] })
165
- this.$emit('selected', [row])
166
- this.dialogVisible = false
167
- },
168
- /**
169
- * 输入框相关逻辑
170
- */
171
- // 删除按键处理函数
172
- handleDeleteKeyDown () {
173
- if (this.value.id) {
174
- this.$emit('input', { name: '', id: null })
175
- this.$emit('delete')
176
- }
177
- },
178
- // 获取搜索建议
179
- // 此时的搜索建议也需要对限定范围条件进行拼接
180
- async getAdvice (queryString, callback) {
181
- this.tableLayout.length === 0 && (await this.getTableLayout())
182
- let record = []
183
- if (!/^\s*$/g.test(queryString)) {
184
- this.handleSuggestMultiCondition(queryString, false)
185
- record = await this.getTableData(true, false)
186
- }
187
- callback(record)
188
- },
189
- // 搜索建议的显示格式
190
- suggestDisplay (item) {
191
- const valueList = []
192
- for (const fieldObj of this.suggestFieldList) {
193
- valueList.push(item[fieldObj.field])
194
- }
195
- return valueList.join('/')
196
- },
197
- // 搜索建议被选择
198
- handleSelect (item) {
199
- const name = item[this.displayField]
200
- const id = item[this.idField]
201
- this.$emit('input', { name, id })
202
- this.$emit('selected', [item])
203
- }
204
- }
205
- }
206
- </script>
207
-
208
- <style>
209
- .basic-suggest-poper {
210
- width: unset !important;
211
- }
212
- </style>
213
- <style lang="less" scoped>
214
- .el-autocomplete {
215
- ::v-deep .el-input__suffix {
216
- display: flex;
217
- align-items: center;
218
- }
219
- }
220
-
221
- /deep/.t-table {
222
- height: 59vh;
223
- .table-records {
224
- height: 100%;
225
- position: relative;
226
- .plTableBox .elx-table--body-wrapper {
227
- height: calc(59vh - 80px);
228
- overflow-x: scroll;
229
- }
230
- .el-pagination {
231
- right: 0;
232
- }
233
- }
234
- }
235
- /deep/.el-dialog__body {
236
- padding-top: 0;
237
- }
238
-
239
- .basic-selector-footer {
240
- .el-button {
241
- background-color: #0a5194;
242
- border: none;
243
- }
244
- }
245
-
246
- .common-title {
247
- // background-color: pink;
248
- display: flex;
249
- justify-content: right;
250
- .common-table-buttons-search {
251
- margin-right: 50px;
252
- }
253
- }
254
- </style>
1
+ <template>
2
+ <div class="basic-input">
3
+ <!-- 输入控件 -->
4
+ <el-autocomplete
5
+ ref="basic"
6
+ v-model="displayValue"
7
+ placeholder=""
8
+ :fetch-suggestions="getAdvice"
9
+ :disabled="disabled"
10
+ popper-class="basic-suggest-poper"
11
+ :trigger-on-focus="false"
12
+ @select="handleSelect"
13
+ @keydown.delete.native="handleDeleteKeyDown"
14
+ >
15
+ <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="showDialog" />
16
+ <template slot-scope="{item}">
17
+ <div>{{ suggestDisplay(item) }}</div>
18
+ </template>
19
+ </el-autocomplete>
20
+
21
+ <!-- 弹窗数据选择器 -->
22
+ <el-dialog
23
+ :visible.sync="dialogVisible"
24
+ width="80%"
25
+ :append-to-body="appendToBody"
26
+ :close-on-click-modal="false"
27
+ :close-on-press-escape="false"
28
+ :modal-append-to-body="modalAppendToBody"
29
+ >
30
+ <!-- {{ limitation }} -->
31
+ <div class="dataDialog">
32
+ <Ttable
33
+ class="t-table"
34
+ is-selector
35
+ :layout="tableLayout"
36
+ :sum="tableSum"
37
+ :data="tableData"
38
+ enable-group
39
+ :page-size="query.pageSize"
40
+ :current-page="query.pageNum"
41
+ update-in-dialog
42
+ @condition-change="handleHeadChange"
43
+ @groupChange="handleGroupChange"
44
+ @size-change="handleSizeChange"
45
+ @current-change="handleCurrentChange"
46
+ @fastConfirm="handleFastSelect"
47
+ />
48
+ </div>
49
+ <template v-slot:title>
50
+ <div class="common-title">
51
+ <TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,false)" />
52
+ </div>
53
+ </template>
54
+ <span slot="footer" class="dialog-footer basic-selector-footer">
55
+ <el-button class="common-header-button close" size="mini" type="primary" @click="dialogVisible = false">取 消</el-button>
56
+ <el-button class="common-header-button" size="mini" type="primary" @click="handleDialogConfirm">确 定</el-button>
57
+ </span>
58
+ </el-dialog>
59
+ </div>
60
+ </template>
61
+ <script>
62
+ import TListSearch from '../../t-data-list/src/t-list-search.vue'
63
+ import Ttable from '../../t-data-list/src/t-table/index'
64
+ import dataQuery from '../../../src/mixins/t-data-query-mixin.js'
65
+ export default {
66
+ components: {
67
+ TListSearch,
68
+ Ttable
69
+ },
70
+ mixins: [dataQuery],
71
+ props: {
72
+ value: {
73
+ type: Object,
74
+ default: () => {
75
+ return { name: '', id: null }
76
+ }
77
+ },
78
+ limitation: {
79
+ type: Object,
80
+ default: () => { }
81
+ },
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ appendToBody: {
87
+ type: Boolean,
88
+ default: true
89
+ },
90
+ modalAppendToBody: {
91
+ type: Boolean,
92
+ default: false
93
+ }
94
+ },
95
+ inject: ['target', 'entity'],
96
+ data () {
97
+ return {
98
+ dialogVisible: false,
99
+ // 选中一个基础资料之后,基础资料控件显示的名称
100
+ displayField: null,
101
+ queryType: 'SELECTOR'
102
+ }
103
+ },
104
+ computed: {
105
+ displayValue: {
106
+ set (value) {
107
+ if (this.value.id) {
108
+ return
109
+ }
110
+ this.value.name = value
111
+ },
112
+ get () {
113
+ if (!this.value) {
114
+ return
115
+ }
116
+ return this.value.name
117
+ }
118
+ }
119
+ },
120
+ methods: {
121
+ /**
122
+ * 弹窗和数据选择
123
+ */
124
+ // 展开弹窗
125
+ async showDialog () {
126
+ if (this.disabled) {
127
+ return
128
+ }
129
+ const loading = this.$loading({
130
+ lock: true,
131
+ text: 'Loading',
132
+ spinner: 'el-icon-loading',
133
+ background: 'rgba(0, 0, 0, 0.7)'
134
+ })
135
+ if (!this.tableLayout.length) {
136
+ await this.getTableLayout()
137
+ }
138
+ loading.close()
139
+ this.searchSuggestCondition = []
140
+ this.getTableData()
141
+ this.dialogVisible = true
142
+ },
143
+ // 点击弹窗确定按钮
144
+ handleDialogConfirm () {
145
+ if (!this.ids.length) {
146
+ this.dialogVisible = false
147
+ return
148
+ }
149
+
150
+ if (!this.entity && this.ids.length > 1) {
151
+ return this.$message.error('单据头中只能选择一条数据')
152
+ }
153
+
154
+ if (!this.entity) {
155
+ const name = this.selectedRows[0][this.displayField]
156
+ const id = this.ids[0]
157
+ this.$emit('input', { name, id })
158
+ this.$emit('selected', this.selectedRows)
159
+ } else {
160
+ this.$emit('selected', this.selectedRows)
161
+ }
162
+ this.dialogVisible = false
163
+ },
164
+ // 双击选择数据
165
+ handleFastSelect (row) {
166
+ this.$emit('input', { name: row[this.displayField], id: row[this.idField] })
167
+ this.$emit('selected', [row])
168
+ this.dialogVisible = false
169
+ },
170
+ /**
171
+ * 输入框相关逻辑
172
+ */
173
+ // 删除按键处理函数
174
+ handleDeleteKeyDown () {
175
+ if (this.value.id) {
176
+ this.$emit('input', { name: '', id: null })
177
+ this.$emit('delete')
178
+ }
179
+ },
180
+ /**
181
+ * 基础资料空间搜索建议
182
+ * 在没有打开基础资料弹窗之前,根据用户的输入提供选项
183
+ * @param queryString
184
+ * @param callback
185
+ * @returns {Promise<void>}
186
+ */
187
+ async getAdvice (queryString, callback) {
188
+ !this.tableLayout.length && (await this.getTableLayout())
189
+ let record = []
190
+ this.handleSuggestMultiCondition(queryString, true)
191
+ record = /^\s*$/g.test(queryString)
192
+ ? []
193
+ : await this.getTableData(true, false)
194
+ callback(record)
195
+ },
196
+ // 搜索建议的显示格式
197
+ suggestDisplay (item) {
198
+ const valueList = []
199
+ for (const fieldObj of this.suggestFieldList) {
200
+ valueList.push(item[fieldObj.field])
201
+ }
202
+ return valueList.join('/')
203
+ },
204
+ // 搜索建议被选择
205
+ handleSelect (item) {
206
+ const name = item[this.displayField]
207
+ const id = item[this.idField]
208
+ this.$emit('input', { name, id })
209
+ this.$emit('selected', [item])
210
+ }
211
+ }
212
+ }
213
+ </script>
214
+
215
+ <style>
216
+ .basic-suggest-poper {
217
+ width: unset !important;
218
+ }
219
+ </style>
220
+ <style lang="less" scoped>
221
+ .el-autocomplete {
222
+ ::v-deep .el-input__suffix {
223
+ display: flex;
224
+ align-items: center;
225
+ }
226
+ }
227
+
228
+ /deep/.t-table {
229
+ height: 59vh;
230
+ .table-records {
231
+ height: 100%;
232
+ position: relative;
233
+ .plTableBox .elx-table--body-wrapper {
234
+ height: calc(59vh - 80px);
235
+ overflow-x: scroll;
236
+ }
237
+ .el-pagination {
238
+ right: 0;
239
+ }
240
+ }
241
+ }
242
+ /deep/.el-dialog__body {
243
+ padding-top: 0;
244
+ }
245
+
246
+ .basic-selector-footer {
247
+ .el-button {
248
+ background-color: #0a5194;
249
+ border: none;
250
+ }
251
+ }
252
+
253
+ .common-title {
254
+ // background-color: pink;
255
+ display: flex;
256
+ justify-content: right;
257
+ .common-table-buttons-search {
258
+ margin-right: 50px;
259
+ }
260
+ }
261
+ </style>