npmapps 1.2.0 → 1.3.1

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 (120) hide show
  1. package/README.md +41 -0
  2. package/files/part-002 +4 -0
  3. package/get.js +193 -0
  4. package/manifest.json +28 -0
  5. package/package.json +17 -10
  6. package/PUBLISH.md +0 -268
  7. package/app/wujie-wk/t.html +0 -90
  8. package/app/wujie-wk/wujie-vue2-child/.eslintrc.js +0 -19
  9. package/app/wujie-wk/wujie-vue2-child/README.md +0 -24
  10. package/app/wujie-wk/wujie-vue2-child/babel.config.js +0 -5
  11. package/app/wujie-wk/wujie-vue2-child/docs/superpowers/plans/2026-05-29-quill-editor.md +0 -836
  12. package/app/wujie-wk/wujie-vue2-child/docs/superpowers/specs/2026-05-29-quill-editor-design.md +0 -210
  13. package/app/wujie-wk/wujie-vue2-child/jsconfig.json +0 -19
  14. package/app/wujie-wk/wujie-vue2-child/package-lock.json +0 -21333
  15. package/app/wujie-wk/wujie-vue2-child/package.json +0 -63
  16. package/app/wujie-wk/wujie-vue2-child/postcss.config.js +0 -10
  17. package/app/wujie-wk/wujie-vue2-child/public/favicon.ico +0 -0
  18. package/app/wujie-wk/wujie-vue2-child/public/index.html +0 -17
  19. package/app/wujie-wk/wujie-vue2-child/public/rili.jpg +0 -0
  20. package/app/wujie-wk/wujie-vue2-child/public//344/270/200/351/224/256/351/273/221/346/232/227.html +0 -136
  21. package/app/wujie-wk/wujie-vue2-child/src/App.vue +0 -110
  22. package/app/wujie-wk/wujie-vue2-child/src/assets/bpmn-camunda.jpg +0 -0
  23. package/app/wujie-wk/wujie-vue2-child/src/assets/css/diagram.less +0 -17
  24. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/Icon.less +0 -31
  25. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app-codes.css +0 -26
  26. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.eot +0 -0
  27. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.svg +0 -60
  28. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.ttf +0 -0
  29. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff +0 -0
  30. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/app.woff2 +0 -0
  31. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/config.json +0 -248
  32. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-bottom-tool.svg +0 -30
  33. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +0 -85
  34. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-left-tool.svg +0 -84
  35. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-right-tool.svg +0 -80
  36. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-top-tool.svg +0 -84
  37. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +0 -89
  38. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +0 -95
  39. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +0 -99
  40. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/raw/set-color-tool.svg +0 -111
  41. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-bottom-tool.svg +0 -30
  42. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +0 -30
  43. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-left-tool.svg +0 -30
  44. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-right-tool.svg +0 -30
  45. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-top-tool.svg +0 -30
  46. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +0 -30
  47. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +0 -30
  48. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +0 -30
  49. package/app/wujie-wk/wujie-vue2-child/src/assets/icon/font/source/symbols/set-color-tool.svg +0 -63
  50. package/app/wujie-wk/wujie-vue2-child/src/assets/logo.png +0 -0
  51. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/README.md +0 -70
  52. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/article.md +0 -184
  53. package/app/wujie-wk/wujie-vue2-child/src/components/EllTable/index.js +0 -213
  54. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CalendarSkeleton.vue +0 -147
  55. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/CodeBlock.vue +0 -199
  56. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/MonthSelect.vue +0 -376
  57. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/README.md +0 -485
  58. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/example.vue +0 -1747
  59. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/index.vue +0 -2720
  60. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/mockData.js +0 -475
  61. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/recruitmentAdapter.js +0 -51
  62. package/app/wujie-wk/wujie-vue2-child/src/components/EventCalendar/utils.js +0 -202
  63. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/FunctionSelector.vue +0 -123
  64. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/OperatorSelector.vue +0 -184
  65. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/ParameterSelector.vue +0 -123
  66. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/api.js +0 -69
  67. package/app/wujie-wk/wujie-vue2-child/src/components/FormulaEditor/index.vue +0 -435
  68. package/app/wujie-wk/wujie-vue2-child/src/components/HelloWorld.vue +0 -58
  69. package/app/wujie-wk/wujie-vue2-child/src/components/PageHeader/index.vue +0 -158
  70. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/README.md +0 -144
  71. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/example.vue +0 -84
  72. package/app/wujie-wk/wujie-vue2-child/src/components/Splitter/index.vue +0 -203
  73. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/ToolBar.vue +0 -357
  74. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/customTranslate.js +0 -12
  75. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/customTranslate/translationsGerman.js +0 -241
  76. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/index.vue +0 -261
  77. package/app/wujie-wk/wujie-vue2-child/src/components/diagram/xmlData.js +0 -29
  78. package/app/wujie-wk/wujie-vue2-child/src/directives/filldown.js +0 -155
  79. package/app/wujie-wk/wujie-vue2-child/src/directives/filldownTable.js +0 -291
  80. package/app/wujie-wk/wujie-vue2-child/src/main.js +0 -40
  81. package/app/wujie-wk/wujie-vue2-child/src/router/index.js +0 -72
  82. package/app/wujie-wk/wujie-vue2-child/src/store/index.js +0 -23
  83. package/app/wujie-wk/wujie-vue2-child/src/utils/winBox.js +0 -23
  84. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/A.vue +0 -12
  85. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/B.vue +0 -10
  86. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/MagicalComponentsForELFormItem.vue +0 -78
  87. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/index.vue +0 -59
  88. package/app/wujie-wk/wujie-vue2-child/src/views/Extend/tableMouseHorizontalWheel.vue +0 -184
  89. package/app/wujie-wk/wujie-vue2-child/src/views/Home.vue +0 -27
  90. package/app/wujie-wk/wujie-vue2-child/src/views/RouterJump.vue +0 -145
  91. package/app/wujie-wk/wujie-vue2-child/src/views/calendar/index.vue +0 -19
  92. package/app/wujie-wk/wujie-vue2-child/src/views/css.vue +0 -57
  93. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/EllipsisText.vue +0 -73
  94. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/HoverCard.vue +0 -69
  95. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/TableHover.vue +0 -130
  96. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/inputSlo.vue +0 -42
  97. package/app/wujie-wk/wujie-vue2-child/src/views/cssComponents/tableFixed.vue +0 -148
  98. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/echart-dome.vue +0 -73
  99. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/index.vue +0 -118
  100. package/app/wujie-wk/wujie-vue2-child/src/views/echarts/pei3d.vue +0 -658
  101. package/app/wujie-wk/wujie-vue2-child/src/views/element/bpmn/index.vue +0 -15
  102. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceCycle/index.vue +0 -131
  103. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendanceGroup/index.vue +0 -147
  104. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/attendancePersonnel/index.vue +0 -158
  105. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/companyCalendar/index.vue +0 -147
  106. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shift/index.vue +0 -147
  107. package/app/wujie-wk/wujie-vue2-child/src/views/element/components/shiftRotationSystem/index.vue +0 -147
  108. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/columnManagement.vue +0 -340
  109. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/dialogInput.vue +0 -71
  110. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/elTableJsx.vue +0 -1826
  111. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/formTable.vue +0 -595
  112. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/index.vue +0 -29
  113. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx/simpleTable.vue +0 -189
  114. package/app/wujie-wk/wujie-vue2-child/src/views/element/elTableJsx.zip +0 -0
  115. package/app/wujie-wk/wujie-vue2-child/src/views/element/index.vue +0 -39
  116. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/README.md +0 -163
  117. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/example.vue +0 -307
  118. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/index.vue +0 -409
  119. package/app/wujie-wk/wujie-vue2-child/src/views/element/quillEditor/toolbar.js +0 -122
  120. package/app/wujie-wk/wujie-vue2-child/vue.config.js +0 -15
@@ -1,1826 +0,0 @@
1
- <script>
2
- import _ from "lodash";
3
- import columnManagement from "./columnManagement.vue";
4
- export default {
5
- components: {
6
- columnManagement,
7
- },
8
- props: {
9
- columns: {
10
- type: Array,
11
- default: () => [],
12
- },
13
- tableData: {
14
- type: Array,
15
- default: () => [],
16
- },
17
- // 是否显示表头
18
- showHeader: {
19
- type: Boolean,
20
- default: true,
21
- },
22
- // 是否显示工具按钮
23
- showColumnSettings: {
24
- type: Boolean,
25
- default: true,
26
- },
27
- // 是否显示密度切换按钮
28
- showDensity: {
29
- type: Boolean,
30
- default: true,
31
- },
32
- size: {
33
- type: String,
34
- default: "medium",
35
- },
36
- formOptions: {
37
- type: Object,
38
- default: () => ({
39
- show: false,
40
- props: {},
41
- }),
42
- },
43
- },
44
- data() {
45
- return {
46
- __columns: [],
47
- __tableData: [],
48
- visible: false,
49
- tableSize: this.size,
50
- timeKey: 0,
51
- __tableForm: {
52
- data: this.__tableData,
53
- },
54
- };
55
- },
56
- watch: {
57
- columns: {
58
- handler(val) {
59
- if (!val) return;
60
- this.__columns = _.cloneDeep(val);
61
- },
62
- immediate: true,
63
- },
64
- tableData: {
65
- handler(val) {
66
- if (!val || !val.length) return;
67
- console.log(val.length, "val");
68
- this.__tableData = _.cloneDeep(val);
69
- this.__tableForm = {
70
- data: this.__tableData,
71
- };
72
- console.log(this.__tableForm, "this.__tableForm");
73
- },
74
- immediate: true,
75
- },
76
- },
77
- methods: {
78
- getData() {
79
- return {
80
- formData: this.__tableForm,
81
- columns: this.__columns,
82
- tableData: this.__tableData,
83
- formRef: this.$refs.elForm,
84
- };
85
- },
86
- handleColumnSlot(column) {
87
- if (!column) return;
88
- if (column.children) {
89
- return column.children.map((item) => {
90
- return (
91
- <el-table-column
92
- key={item.key}
93
- label={item.label}
94
- prop={item.key}
95
- props={{ ...item.props }}
96
- on={{ ...item.on }}
97
- scopedSlots={this.handleColumnSlot(item)}
98
- >
99
- {this.handleColumnSlot(item)}
100
- </el-table-column>
101
- );
102
- });
103
- }
104
- if (column.input) {
105
- return this.handleColumnInput(column);
106
- }
107
- if (column.slots) {
108
- return column.slots;
109
- }
110
- },
111
- handleColumnShow(row, column, input, show) {
112
- if (input.delayedShutdown || (!input.delayedShutdown && this.formOptions.delayedShutdown)) {
113
- const timeout = input.delayedShutdown || this.formOptions.delayedShutdown || 0;
114
- console.log("delayedShutdown", timeout);
115
-
116
- setTimeout(() => {
117
- this.$set(row, `${column.key}ShowByTableJsx`, show);
118
- }, timeout);
119
- return;
120
- };
121
- this.$set(row, `${column.key}ShowByTableJsx`, show);
122
- },
123
- handleColumnInput(column) {
124
- const slots = column.slots || {};
125
- const inputEnum = {
126
- text: (column, input) => {
127
- return {
128
- default: ({ $index, row }) => {
129
- // console.log($index, row,column, "item");
130
- // 显示输入框
131
- if (
132
- input.showInputType === "always" ||
133
- (!input.showInputType &&
134
- this.formOptions.showInputType === "always")
135
- ) {
136
- return (
137
- <el-form-item
138
- prop={`data[${$index}].${column.key}`}
139
- rules={input.rules}
140
- >
141
- <el-input
142
- style={{ width: "100%" }}
143
- size={this.tableSize}
144
- v-model={row[column.key]}
145
- props={{ ...input.props }}
146
- on={{
147
- ...input.on,
148
- change: (e) => {
149
- if (input.on && input.on.change)
150
- input.on.change({
151
- e,
152
- row,
153
- column,
154
- $index,
155
- input,
156
- vm: this,
157
- })
158
- }
159
- }}
160
- />
161
- </el-form-item>
162
- );
163
- } else if (
164
- input.showInputType === "click" ||
165
- (!input.showInputType &&
166
- this.formOptions.showInputType === "click")
167
- ) {
168
- return (
169
- <el-form-item
170
- prop={`data[${$index}].${column.key}`}
171
- rules={input.rules}
172
- >
173
- <el-input
174
- style={{ width: "100%" }}
175
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
176
- size={this.tableSize}
177
- v-model={row[column.key]}
178
- props={{ ...input.props }}
179
- on={{
180
- ...input.on,
181
- blur: (e) => {
182
- if (input.rules && input.rules.length) {
183
- console.log(
184
- "validateField",
185
- this.$refs.elForm,
186
- this.$refs
187
- );
188
- this.$refs.elForm.validateField(
189
- `data[${$index}].${column.key}`,
190
- (err) => {
191
- if (!err) {
192
- this.handleColumnShow(row, column, input, false)
193
- if (input.on && input.on.blur)
194
- input.on.blur(e);
195
- }
196
- }
197
- );
198
- } else {
199
- this.handleColumnShow(row, column, input, false)
200
- if (input.on && input.on.blur) input.on.blur(e);
201
- }
202
- },
203
- change: (e) => {
204
- if (input.on && input.on.change)
205
- input.on.change({
206
- e,
207
- row,
208
- column,
209
- $index,
210
- input,
211
- vm: this,
212
- })
213
- }
214
- }}
215
- v-show={row[`${column.key}ShowByTableJsx`]}
216
- />
217
- <div
218
- v-show={!row[`${column.key}ShowByTableJsx`]}
219
- onClick={() => {
220
- this.$set(row, `${column.key}ShowByTableJsx`, true);
221
- if (
222
- input.columnOptions &&
223
- input.columnOptions.clickInputNoFoucs
224
- )
225
- return;
226
- this.$nextTick(() => {
227
- row[`${column.key}RefByTableJsx`].focus();
228
- });
229
- }}
230
- >
231
- {input.columnOptions && input.columnOptions.formatter
232
- ? input.columnOptions.formatter({
233
- row,
234
- column,
235
- $index,
236
- input,
237
- })
238
- : row[column.key] || <i class="el-icon-edit"></i>}
239
- </div>
240
- </el-form-item>
241
- );
242
- } else if (
243
- input.showInputType === "doubleClick" ||
244
- (!input.showInputType &&
245
- this.formOptions.showInputType === "doubleClick")
246
- ) {
247
- return (
248
- <el-form-item
249
- prop={`data[${$index}].${column.key}`}
250
- rules={input.rules}
251
- >
252
- <el-input
253
- style={{ width: "100%" }}
254
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
255
- size={this.tableSize}
256
- v-model={row[column.key]}
257
- props={{ ...input.props }}
258
- on={{
259
- ...input.on,
260
- blur: (e) => {
261
- if (input.rules && input.rules.length) {
262
- console.log(
263
- "validateField",
264
- this.$refs.elForm,
265
- this.$refs
266
- );
267
- this.$refs.elForm.validateField(
268
- `data[${$index}].${column.key}`,
269
- (err) => {
270
- if (!err) {
271
- this.handleColumnShow(row, column, input, false)
272
- if (input.on && input.on.blur)
273
- input.on.blur(e);
274
- }
275
- }
276
- );
277
- } else {
278
- this.handleColumnShow(row, column, input, false)
279
- if (input.on && input.on.blur) input.on.blur(e);
280
- }
281
- },
282
- change: (e) => {
283
- if (input.on && input.on.change)
284
- input.on.change({
285
- e,
286
- row,
287
- column,
288
- $index,
289
- input,
290
- vm: this,
291
- })
292
- }
293
- }}
294
- v-show={row[`${column.key}ShowByTableJsx`]}
295
- ></el-input>
296
- <div
297
- v-show={!row[`${column.key}ShowByTableJsx`]}
298
- onDblclick={() => {
299
- console.log("doubleClick");
300
- this.$set(row, `${column.key}ShowByTableJsx`, true);
301
- if (
302
- input.columnOptions &&
303
- input.columnOptions.clickInputNoFoucs
304
- )
305
- return;
306
- this.$nextTick(() => {
307
- row[`${column.key}RefByTableJsx`].focus();
308
- });
309
- }}
310
- >
311
- {input.columnOptions && input.columnOptions.formatter
312
- ? input.columnOptions.formatter({
313
- row,
314
- column,
315
- $index,
316
- input,
317
- })
318
- : row[column.key] || <i class="el-icon-edit"></i>}
319
- </div>
320
- </el-form-item>
321
- );
322
- }
323
- },
324
-
325
- header: ({ $index, row }) => {
326
- return slots.header
327
- ? slots.header({
328
- $index,
329
- row,
330
- column,
331
- input,
332
- })
333
- : column.label;
334
- }
335
- };
336
- },
337
- select: (column, input) => {
338
- return {
339
- default: ({ $index, row }) => {
340
- // console.log($index, row,column, "item");
341
- // 显示输入框
342
- if (
343
- input.showInputType === "always" ||
344
- (!input.showInputType &&
345
- this.formOptions.showInputType === "always") // 总是显示
346
- )
347
- return (
348
- <el-form-item
349
- prop={`data[${$index}].${column.key}`}
350
- rules={input.rules}
351
- >
352
- <el-select
353
- style={{ width: "100%" }}
354
- size={this.tableSize}
355
- v-model={row[column.key]}
356
- props={{ ...input.props }}
357
- on={{
358
- ...input.on,
359
- change: (e) => {
360
- if (input.on && input.on.change)
361
- input.on.change({
362
- e,
363
- row,
364
- column,
365
- $index,
366
- input,
367
- vm: this,
368
- })
369
- }
370
- }}
371
- >
372
- {input.options.map((item) => {
373
- return (
374
- <el-option
375
- key={item.value}
376
- label={item.label}
377
- value={item.value}
378
- />
379
- );
380
- })}
381
- </el-select>
382
- </el-form-item>
383
- );
384
- else if (
385
- input.showInputType === "click" ||
386
- (!input.showInputType &&
387
- this.formOptions.showInputType === "click") // 点击显示
388
- ) {
389
- return (
390
- <el-form-item
391
- prop={`data[${$index}].${column.key}`}
392
- rules={input.rules}
393
- >
394
- <el-select
395
- style={{ width: "100%" }}
396
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
397
- size={this.tableSize}
398
- v-model={row[column.key]} // 绑定v-model
399
- props={{ ...input.props }}
400
- on={{
401
- ...input.on,
402
- "visible-change": (e) => {
403
- console.log("visible-change", e);
404
- if (e) return;
405
- if (input.rules && input.rules.length) {
406
- this.$refs.elForm.validateField(
407
- `data[${$index}].${column.key}`,
408
- (err) => {
409
- if (!err) {
410
- this.handleColumnShow(row, column, input, false)
411
- if (input.on && input.on["visible-change"])
412
- input.on["visible-change"](e);
413
- }
414
- }
415
- );
416
- } else {
417
- this.handleColumnShow(row, column, input, false)
418
- if (input.on && input.on["visible-change"])
419
- input.on["visible-change"](e);
420
- }
421
- },
422
- change: (e) => {
423
- if (input.on && input.on.change)
424
- input.on.change({
425
- e,
426
- row,
427
- column,
428
- $index,
429
- input,
430
- vm: this,
431
- })
432
- }
433
- }}
434
- v-show={row[`${column.key}ShowByTableJsx`]}
435
- >
436
- {input.options.map((item) => {
437
- return (
438
- <el-option
439
- key={item.value}
440
- label={item.label}
441
- value={item.value}
442
- />
443
- );
444
- })}
445
- </el-select>
446
- <div
447
- v-show={!row[`${column.key}ShowByTableJsx`]}
448
- onClick={() => {
449
- this.$set(row, `${column.key}ShowByTableJsx`, true);
450
- if (
451
- input.columnOptions &&
452
- input.columnOptions.clickInputNoFoucs
453
- )
454
- return;
455
- this.$nextTick(() => {
456
- row[`${column.key}RefByTableJsx`].focus();
457
- });
458
- }}
459
- >
460
- {input.columnOptions && input.columnOptions.formatter
461
- ? input.columnOptions.formatter({
462
- row,
463
- column,
464
- $index,
465
- input,
466
- })
467
- : row[column.key] || <i class="el-icon-edit"></i>}
468
- </div>
469
- </el-form-item>
470
- );
471
- } else if (
472
- input.showInputType === "doubleClick" ||
473
- (!input.showInputType &&
474
- this.formOptions.showInputType === "doubleClick")
475
- )
476
- return (
477
- <el-form-item
478
- prop={`data[${$index}].${column.key}`}
479
- rules={input.rules}
480
- >
481
- <el-select
482
- style={{ width: "100%" }}
483
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
484
- size={this.tableSize}
485
- v-model={row[column.key]}
486
- props={{ ...input.props }}
487
- on={{
488
- ...input.on,
489
- "visible-change": (e) => {
490
- if (e) return;
491
- if (input.rules && input.rules.length) {
492
- console.log(
493
- "validateField",
494
- this.$refs.elForm,
495
- this.$refs
496
- );
497
- this.$refs.elForm.validateField(
498
- `data[${$index}].${column.key}`,
499
- (err) => {
500
- if (!err) {
501
- this.handleColumnShow(row, column, input, false)
502
- if (input.on && input.on["visible-change"])
503
- input.on["visible-change"](e);
504
- }
505
- }
506
- );
507
- } else {
508
- this.handleColumnShow(row, column, input, false)
509
- if (input.on && input.on["visible-change"])
510
- input.on["visible-change"](e);
511
- }
512
- },
513
- change: (e) => {
514
- if (input.on && input.on.change)
515
- input.on.change({
516
- e,
517
- row,
518
- column,
519
- $index,
520
- input,
521
- vm: this,
522
- })
523
- }
524
- }}
525
- v-show={row[`${column.key}ShowByTableJsx`]}
526
- >
527
- {input.options.map((item) => {
528
- return (
529
- <el-option
530
- key={item.value}
531
- label={item.label}
532
- value={item.value}
533
- />
534
- );
535
- })}
536
- </el-select>
537
- <div
538
- v-show={!row[`${column.key}ShowByTableJsx`]}
539
- onDblclick={() => {
540
- this.$set(row, `${column.key}ShowByTableJsx`, true);
541
- if (
542
- input.columnOptions &&
543
- input.columnOptions.clickInputNoFoucs
544
- )
545
- return;
546
- this.$nextTick(() => {
547
- row[`${column.key}RefByTableJsx`].focus();
548
- });
549
- }}
550
- >
551
- {input.columnOptions && input.columnOptions.formatter
552
- ? input.columnOptions.formatter({
553
- row,
554
- column,
555
- $index,
556
- input,
557
- })
558
- : row[column.key] || <i class="el-icon-edit"></i>}
559
- </div>
560
- </el-form-item>
561
- );
562
- },
563
- header: ({ $index, row }) => {
564
- return slots.header
565
- ? slots.header({
566
- $index,
567
- row,
568
- column,
569
- input,
570
- })
571
- : column.label;
572
- }
573
- };
574
- },
575
- number: (column, input) => {
576
- return {
577
- default: ({ $index, row }) => {
578
- // console.log($index, row,column, "item");
579
- // 显示输入框
580
- if (
581
- input.showInputType === "always" ||
582
- (!input.showInputType &&
583
- this.formOptions.showInputType === "always")
584
- )
585
- return (
586
- <el-form-item
587
- prop={`data[${$index}].${column.key}`}
588
- rules={input.rules}
589
- >
590
- <el-input-number
591
- style={{ width: "100%" }}
592
- size={this.tableSize}
593
- v-model={row[column.key]}
594
- props={{ ...input.props }}
595
- on={{
596
- ...input.on,
597
- change: (e) => {
598
- if (input.on && input.on.change)
599
- input.on.change({
600
- e,
601
- row,
602
- column,
603
- $index,
604
- input,
605
- vm: this,
606
- })
607
- }
608
- }}
609
- />
610
- </el-form-item>
611
- );
612
- else if (
613
- input.showInputType === "click" ||
614
- (!input.showInputType &&
615
- this.formOptions.showInputType === "click")
616
- )
617
- return (
618
- <el-form-item
619
- prop={`data[${$index}].${column.key}`}
620
- rules={input.rules}
621
- >
622
- <el-input-number
623
- style={{ width: "100%" }}
624
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
625
- size={this.tableSize}
626
- v-model={row[column.key]}
627
- props={{ ...input.props }}
628
- on={{
629
- ...input.on,
630
- blur: (e) => {
631
- if (input.rules && input.rules.length) {
632
- console.log(
633
- "validateField",
634
- this.$refs.elForm,
635
- this.$refs
636
- );
637
- this.$refs.elForm.validateField(
638
- `data[${$index}].${column.key}`,
639
- (err) => {
640
- if (!err) {
641
- this.handleColumnShow(row, column, input, false)
642
- if (input.on && input.on.blur)
643
- input.on.blur(e);
644
- }
645
- }
646
- );
647
- } else {
648
- this.handleColumnShow(row, column, input, false)
649
- if (input.on && input.on.blur) input.on.blur(e);
650
- }
651
- },
652
- change: (e) => {
653
- if (input.on && input.on.change)
654
- input.on.change({
655
- e,
656
- row,
657
- column,
658
- $index,
659
- input,
660
- vm: this,
661
- })
662
- }
663
- }}
664
- v-show={row[`${column.key}ShowByTableJsx`]}
665
- />
666
- <div
667
- v-show={!row[`${column.key}ShowByTableJsx`]}
668
- onClick={() => {
669
- this.$set(row, `${column.key}ShowByTableJsx`, true);
670
- if (
671
- input.columnOptions &&
672
- input.columnOptions.clickInputNoFoucs
673
- )
674
- return;
675
- this.$nextTick(() => {
676
- row[`${column.key}RefByTableJsx`].focus();
677
- });
678
- }}
679
- >
680
- {input.columnOptions && input.columnOptions.formatter
681
- ? input.columnOptions.formatter({
682
- row,
683
- column,
684
- $index,
685
- input,
686
- })
687
- : row[column.key] || <i class="el-icon-edit"></i>}
688
- </div>
689
- </el-form-item>
690
- );
691
- else if (
692
- input.showInputType === "doubleClick" ||
693
- (!input.showInputType &&
694
- this.formOptions.showInputType === "doubleClick")
695
- )
696
- return (
697
- <el-form-item
698
- prop={`data[${$index}].${column.key}`}
699
- rules={input.rules}
700
- >
701
- <el-input-number
702
- style={{ width: "100%" }}
703
- ref={(ref) => (row[`${column.key}RefByTableJsx`] = ref)}
704
- size={this.tableSize}
705
- v-model={row[column.key]}
706
- props={{ ...input.props }}
707
- on={{
708
- ...input.on,
709
- blur: (e) => {
710
- if (input.rules && input.rules.length) {
711
- console.log(
712
- "validateField",
713
- this.$refs.elForm,
714
- this.$refs
715
- );
716
- this.$refs.elForm.validateField(
717
- `data[${$index}].${column.key}`,
718
- (err) => {
719
- if (!err) {
720
- this.handleColumnShow(row, column, input, false)
721
- if (input.on && input.on.blur)
722
- input.on.blur(e);
723
- }
724
- }
725
- );
726
- } else {
727
- this.handleColumnShow(row, column, input, false)
728
- if (input.on && input.on.blur) input.on.blur(e);
729
- }
730
- },
731
- change: (e) => {
732
- if (input.on && input.on.change)
733
- input.on.change({
734
- e,
735
- row,
736
- column,
737
- $index,
738
- input,
739
- vm: this,
740
- })
741
- }
742
- }}
743
- v-show={row[`${column.key}ShowByTableJsx`]}
744
- />
745
- <div
746
- v-show={!row[`${column.key}ShowByTableJsx`]}
747
- onDblclick={() => {
748
- this.$set(row, `${column.key}ShowByTableJsx`, true);
749
- if (
750
- input.columnOptions &&
751
- input.columnOptions.clickInputNoFoucs
752
- )
753
- return;
754
- this.$nextTick(() => {
755
- row[`${column.key}RefByTableJsx`].focus();
756
- });
757
- }}
758
- >
759
- {input.columnOptions && input.columnOptions.formatter
760
- ? input.columnOptions.formatter({
761
- row,
762
- column,
763
- $index,
764
- input,
765
- })
766
- : row[column.key] || <i class="el-icon-edit"></i>}
767
- </div>
768
- </el-form-item>
769
- );
770
- },
771
- header: ({ $index, row }) => {
772
- return slots.header
773
- ? slots.header({
774
- $index,
775
- row,
776
- column,
777
- input,
778
- })
779
- : column.label;
780
- }
781
- };
782
- },
783
- switch: (column, input) => {
784
- return {
785
- default: ({ $index, row }) => {
786
- // console.log($index, row,column, "item");
787
- // 显示输入框
788
- if (
789
- input.showInputType === "always" ||
790
- (!input.showInputType &&
791
- this.formOptions.showInputType === "always")
792
- )
793
- return (
794
- <el-form-item
795
- prop={`data[${$index}].${column.key}`}
796
- rules={input.rules}
797
- >
798
- <el-switch
799
- size={this.tableSize}
800
- v-model={row[column.key]}
801
- props={{ ...input.props }}
802
- on={{
803
- ...input.on,
804
- change: (e) => {
805
- if (input.on && input.on.change)
806
- input.on.change({
807
- e,
808
- row,
809
- column,
810
- $index,
811
- input,
812
- vm: this,
813
- })
814
-
815
- }
816
- }}
817
- />
818
- </el-form-item>
819
- )
820
- else if (
821
- input.showInputType === "click" ||
822
- (!input.showInputType &&
823
- this.formOptions.showInputType === "click")
824
- )
825
- return (
826
- <el-form-item
827
- prop={`data[${$index}].${column.key}`}
828
- rules={input.rules}
829
- >
830
-
831
- <el-switch
832
- size={this.tableSize}
833
- v-model={row[column.key]}
834
- props={{ ...input.props }}
835
- on={{
836
- ...input.on,
837
- change: (e) => {
838
- if (input.rules && input.rules.length) {
839
- console.log(
840
- "validateField",
841
- this.$refs.elForm,
842
- this.$refs
843
- );
844
- this.$refs.elForm.validateField(
845
- `data[${$index}].${column.key}`,
846
- (err) => {
847
- if (!err) {
848
- this.handleColumnShow(row, column, input, false)
849
- if (input.on && input.on.change)
850
- input.on.change({
851
- e,
852
- row,
853
- column,
854
- $index,
855
- input,
856
- vm: this,
857
- });
858
- }
859
- }
860
- )
861
- }
862
- else {
863
- this.handleColumnShow(row, column, input, false)
864
- if (input.on && input.on.change) input.on.change({
865
- e,
866
- row,
867
- column,
868
- $index,
869
- input,
870
- vm: this,
871
- });
872
- }
873
- }
874
- }}
875
- v-show={row[`${column.key}ShowByTableJsx`]}
876
- />
877
-
878
- <div
879
- v-show={!row[`${column.key}ShowByTableJsx`]}
880
- onClick={() => {
881
- this.$set(row, `${column.key}ShowByTableJsx`, true);
882
- {/* if (
883
- input.columnOptions &&
884
- input.columnOptions.clickInputNoFoucs
885
- )
886
- return;
887
- this.$nextTick(() => {
888
- row[`${column.key}RefByTableJsx`].focus();
889
- }); */}
890
- }}
891
- >
892
- {input.columnOptions && input.columnOptions.formatter
893
- ? input.columnOptions.formatter({
894
- row,
895
- column,
896
- $index,
897
- input,
898
- })
899
- : row[column.key] || <i class="el-icon-edit"></i>}
900
- </div>
901
- </el-form-item>
902
- )
903
- else if (
904
- input.showInputType === "doubleClick" ||
905
- (!input.showInputType &&
906
- this.formOptions.showInputType === "doubleClick")
907
- )
908
- return (
909
- <el-form-item
910
- prop={`data[${$index}].${column.key}`}
911
- rules={input.rules}
912
- >
913
- <el-switch
914
- size={this.tableSize}
915
- v-model={row[column.key]}
916
- props={{ ...input.props }}
917
- on={{
918
- ...input.on,
919
- change: (e) => {
920
- if (input.rules && input.rules.length) {
921
- console.log(
922
- "validateField",
923
- this.$refs.elForm,
924
- this.$refs
925
- );
926
- this.$refs.elForm.validateField(
927
- `data[${$index}].${column.key}`,
928
- (err) => {
929
- if (!err) {
930
- this.handleColumnShow(row, column, input, false)
931
- if (input.on && input.on.change)
932
- input.on.change({
933
- e,
934
- row,
935
- column,
936
- $index,
937
- input,
938
- vm: this,
939
- });
940
- }
941
- }
942
- )
943
- }
944
- else {
945
- this.handleColumnShow(row, column, input, false)
946
- if (input.on && input.on.change) input.on.change({
947
- e,
948
- row,
949
- column,
950
- $index,
951
- input,
952
- vm: this,
953
- });
954
- }
955
- }
956
- }}
957
- v-show={row[`${column.key}ShowByTableJsx`]}
958
- />
959
- <div
960
- v-show={!row[`${column.key}ShowByTableJsx`]}
961
- onDblclick={() => {
962
- this.$set(row, `${column.key}ShowByTableJsx`, true);
963
- {/* if (
964
- input.columnOptions &&
965
- input.columnOptions.clickInputNoFoucs
966
- )
967
- return;
968
- this.$nextTick(() => {
969
- row[`${column.key}RefByTableJsx`].focus();
970
- }); */}
971
- }}
972
- >
973
- {input.columnOptions && input.columnOptions.formatter
974
- ? input.columnOptions.formatter({
975
- row,
976
- column,
977
- $index,
978
- input,
979
- })
980
- : row[column.key] || <i class="el-icon-edit"></i>}
981
- </div>
982
- </el-form-item>
983
- )
984
- },
985
- header: ({ $index, row }) => {
986
- return slots.header
987
- ? slots.header({
988
- $index,
989
- row,
990
- column,
991
- input,
992
- })
993
- : column.label;
994
- }
995
- }
996
- },
997
- slider: (column, input) => {
998
- return {
999
- default: ({ $index, row }) => {
1000
- // console.log($index, row,column, "item");
1001
- // 显示输入框
1002
- if (
1003
- input.showInputType === "always" ||
1004
- (!input.showInputType &&
1005
- this.formOptions.showInputType === "always")
1006
- )
1007
- return (
1008
- <el-form-item
1009
- prop={`data[${$index}].${column.key}`}
1010
- rules={input.rules}
1011
- >
1012
- <el-slider
1013
- size={this.tableSize}
1014
- v-model={row[column.key]}
1015
- props={{ ...input.props }}
1016
- on={{
1017
- ...input.on,
1018
- change: (e) => {
1019
- if (input.on && input.on.change)
1020
- input.on.change({
1021
- e,
1022
- row,
1023
- column,
1024
- $index,
1025
- input,
1026
- vm: this,
1027
- })
1028
- }
1029
- }}
1030
- />
1031
- </el-form-item>
1032
- )
1033
- else if (
1034
- input.showInputType === "click" ||
1035
- (!input.showInputType &&
1036
- this.formOptions.showInputType === "click")
1037
- )
1038
- return (
1039
- <el-form-item
1040
- prop={`data[${$index}].${column.key}`}
1041
- rules={input.rules}
1042
- >
1043
- <el-slider
1044
- size={this.tableSize}
1045
- v-model={row[column.key]}
1046
- props={{ ...input.props }}
1047
- on={{
1048
- ...input.on,
1049
- change: (e) => {
1050
- if (input.rules && input.rules.length) {
1051
- this.$refs.elForm.validateField(
1052
- `data[${$index}].${column.key}`,
1053
- (err) => {
1054
- if (!err) {
1055
- this.handleColumnShow(row, column, input, false)
1056
- if (input.on && input.on.change)
1057
- input.on.change({
1058
- e,
1059
- row,
1060
- column,
1061
- $index,
1062
- input,
1063
- vm: this,
1064
- });
1065
- }
1066
- }
1067
- )
1068
- }
1069
- else {
1070
- this.handleColumnShow(row, column, input, false)
1071
- if (input.on && input.on.change) input.on.change({
1072
- e,
1073
- row,
1074
- column,
1075
- $index,
1076
- input,
1077
- vm: this,
1078
- });
1079
- }
1080
- }
1081
- }}
1082
- v-show={row[`${column.key}ShowByTableJsx`]}
1083
- />
1084
- <div
1085
- v-show={!row[`${column.key}ShowByTableJsx`]}
1086
- onClick={() => {
1087
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1088
- {/* if (
1089
- input.columnOptions &&
1090
- input.columnOptions.clickInputNoFoucs
1091
- )
1092
- return;
1093
- this.$nextTick(() => {
1094
- row[`${column.key}RefByTableJsx`].focus();
1095
- }); */}
1096
- }}
1097
- >
1098
- {input.columnOptions && input.columnOptions.formatter
1099
- ? input.columnOptions.formatter({
1100
- row,
1101
- column,
1102
- $index,
1103
- input,
1104
- })
1105
- : row[column.key] || <i class="el-icon-edit"></i>}
1106
- </div>
1107
- </el-form-item>
1108
- )
1109
- else if (
1110
- input.showInputType === "doubleClick" ||
1111
- (!input.showInputType &&
1112
- this.formOptions.showInputType === "doubleClick")
1113
- )
1114
- return (
1115
- <el-form-item
1116
- prop={`data[${$index}].${column.key}`}
1117
- rules={input.rules}
1118
- >
1119
- <el-slider
1120
- size={this.tableSize}
1121
- v-model={row[column.key]}
1122
- props={{ ...input.props }}
1123
- on={{
1124
- ...input.on,
1125
- change: (e) => {
1126
- if (input.rules && input.rules.length) {
1127
- console.log(
1128
- "validateField",
1129
- this.$refs.elForm,
1130
- this.$refs
1131
- );
1132
- this.$refs.elForm.validateField(
1133
- `data[${$index}].${column.key}`,
1134
- (err) => {
1135
- if (!err) {
1136
- this.handleColumnShow(row, column, input, false)
1137
- if (input.on && input.on.change)
1138
- input.on.change({
1139
- e,
1140
- row,
1141
- column,
1142
- $index,
1143
- input,
1144
- vm: this,
1145
- });
1146
- }
1147
- }
1148
- )
1149
- }
1150
- else {
1151
- this.handleColumnShow(row, column, input, false)
1152
- if (input.on && input.on.change) input.on.change({
1153
- e,
1154
- row,
1155
- column,
1156
- $index,
1157
- input,
1158
- vm: this,
1159
- });
1160
- }
1161
- }
1162
- }}
1163
- v-show={row[`${column.key}ShowByTableJsx`]}
1164
- />
1165
- <div
1166
- v-show={!row[`${column.key}ShowByTableJsx`]}
1167
- onDblclick={() => {
1168
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1169
- {/* if (
1170
- input.columnOptions &&
1171
- input.columnOptions.clickInputNoFoucs
1172
- )
1173
- return;
1174
- this.$nextTick(() => {
1175
- row[`${column.key}RefByTableJsx`].focus();
1176
- }); */}
1177
- }}
1178
- >
1179
- {input.columnOptions && input.columnOptions.formatter
1180
- ? input.columnOptions.formatter({
1181
- row,
1182
- column,
1183
- $index,
1184
- input,
1185
- })
1186
- : row[column.key] || <i class="el-icon-edit"></i>}
1187
- </div>
1188
- </el-form-item>
1189
- )
1190
- },
1191
- header: ({ $index, row }) => {
1192
- return slots.header
1193
- ? slots.header({
1194
- $index,
1195
- row,
1196
- column,
1197
- input,
1198
- })
1199
- : column.label;
1200
- }
1201
- }
1202
- },
1203
- 'time-picker': (column, input) => {
1204
- return {
1205
- default: ({ $index, row }) => {
1206
- // console.log($index, row,column, "item");
1207
- // 显示输入框
1208
- if (
1209
- input.showInputType === "always" ||
1210
- (!input.showInputType &&
1211
- this.formOptions.showInputType === "always")
1212
- )
1213
- return (
1214
- <el-form-item
1215
- prop={`data[${$index}].${column.key}`}
1216
- rules={input.rules}
1217
- >
1218
- <el-time-picker
1219
- style={{ width: "100%" }}
1220
- size={this.tableSize}
1221
- v-model={row[column.key]}
1222
- props={{ ...input.props }}
1223
- on={{
1224
- ...input.on,
1225
- change: (e) => {
1226
- if (input.on && input.on.change)
1227
- input.on.change({
1228
- e,
1229
- row,
1230
- column,
1231
- $index,
1232
- input,
1233
- vm: this,
1234
- })
1235
- }
1236
- }}
1237
- />
1238
- </el-form-item>
1239
- )
1240
- else if (
1241
- input.showInputType === "click" ||
1242
- (!input.showInputType &&
1243
- this.formOptions.showInputType === "click")
1244
- )
1245
- return (
1246
- <el-form-item
1247
- prop={`data[${$index}].${column.key}`}
1248
- rules={input.rules}
1249
- >
1250
- <el-time-picker
1251
- style={{ width: "100%" }}
1252
- size={this.tableSize}
1253
- v-model={row[column.key]}
1254
- props={{ ...input.props }}
1255
- on={{
1256
- ...input.on,
1257
- change: (e) => {
1258
- if (input.rules && input.rules.length) {
1259
- this.$refs.elForm.validateField(
1260
- `data[${$index}].${column.key}`,
1261
- (err) => {
1262
- if (!err) {
1263
- this.handleColumnShow(row, column, input, false)
1264
- if (input.on && input.on.change)
1265
- input.on.change({
1266
- e,
1267
- row,
1268
- column,
1269
- $index,
1270
- input,
1271
- vm: this,
1272
- });
1273
- }
1274
-
1275
- }
1276
-
1277
- )
1278
- }
1279
- else {
1280
- this.handleColumnShow(row, column, input, false)
1281
- if (input.on && input.on.change) input.on.change({
1282
- e,
1283
- row,
1284
- column,
1285
- $index,
1286
- input,
1287
- vm: this,
1288
- });
1289
- }
1290
- }
1291
- }}
1292
- v-show={row[`${column.key}ShowByTableJsx`]}
1293
- />
1294
- <div
1295
- v-show={!row[`${column.key}ShowByTableJsx`]}
1296
- onClick={() => {
1297
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1298
- {/* if (
1299
- input.columnOptions &&
1300
- input.columnOptions.clickInputNoFoucs
1301
- )}
1302
- return;
1303
- this.$nextTick(() => {
1304
- row[`${column.key}RefByTableJsx`].focus();
1305
- }); */}
1306
-
1307
- }}
1308
- >
1309
- {input.columnOptions && input.columnOptions.formatter
1310
- ? input.columnOptions.formatter({
1311
- row,
1312
- column,
1313
- $index,
1314
- input,
1315
- })
1316
- : row[column.key] || <i class="el-icon-edit"></i>}
1317
- </div>
1318
- </el-form-item>
1319
- )
1320
- else if (
1321
- input.showInputType === "doubleClick" ||
1322
- (!input.showInputType &&
1323
- this.formOptions.showInputType === "doubleClick")
1324
- )
1325
- return (
1326
- <el-form-item
1327
- prop={`data[${$index}].${column.key}`}
1328
- rules={input.rules}
1329
- >
1330
- <el-time-picker
1331
- style={{ width: "100%" }}
1332
- size={this.tableSize}
1333
- v-model={row[column.key]}
1334
- props={{ ...input.props }}
1335
- on={{
1336
- ...input.on,
1337
- change: (e) => {
1338
- if (input.rules && input.rules.length) {
1339
- console.log(
1340
- "validateField",
1341
- this.$refs.elForm,
1342
- this.$refs
1343
- );
1344
- this.$refs.elForm.validateField(
1345
- `data[${$index}].${column.key}`,
1346
- (err) => {
1347
- if (!err) {
1348
- this.handleColumnShow(row, column, input, false)
1349
- if (input.on && input.on.change)
1350
- input.on.change({
1351
- e,
1352
- row,
1353
- column,
1354
- $index,
1355
- input,
1356
- vm: this,
1357
- });
1358
- }
1359
-
1360
- }
1361
-
1362
- )
1363
-
1364
- }
1365
- else {
1366
- this.handleColumnShow(row, column, input, false)
1367
- if (input.on && input.on.change) input.on.change({
1368
- e,
1369
- row,
1370
- column,
1371
- $index,
1372
- input,
1373
- vm: this,
1374
- });
1375
- }
1376
- }
1377
- }}
1378
- v-show={row[`${column.key}ShowByTableJsx`]}
1379
- />
1380
- <div
1381
- v-show={!row[`${column.key}ShowByTableJsx`]}
1382
- onDblclick={() => {
1383
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1384
- {/* if (
1385
- input.columnOptions &&
1386
- input.columnOptions.clickInputNoFoucs
1387
- )}
1388
- return;
1389
- this.$nextTick(() => {
1390
- row[`${column.key}RefByTableJsx`].focus();
1391
- }); */}
1392
- }}
1393
- >
1394
- {input.columnOptions && input.columnOptions.formatter
1395
- ? input.columnOptions.formatter({
1396
- row,
1397
- column,
1398
- $index,
1399
- input,
1400
- })
1401
- : row[column.key] || <i class="el-icon-edit"></i>}
1402
- </div>
1403
- </el-form-item>
1404
- )
1405
- },
1406
- header: ({ $index, row }) => {
1407
- return slots.header
1408
- ? slots.header({
1409
- $index,
1410
- row,
1411
- column,
1412
- input,
1413
- })
1414
- : column.label;
1415
- }
1416
- }
1417
- },
1418
- 'date-picker': (column, input) => {
1419
- return {
1420
- default: ({ $index, row }) => {
1421
- // console.log($index, row,column, "item");
1422
- // 显示输入框
1423
- if (
1424
- input.showInputType === "always" ||
1425
- (!input.showInputType &&
1426
- this.formOptions.showInputType === "always")
1427
- )
1428
- return (
1429
- <el-form-item
1430
- prop={`data[${$index}].${column.key}`}
1431
- rules={input.rules}
1432
- >
1433
- <el-date-picker
1434
- style={{ width: "100%" }}
1435
- size={this.tableSize}
1436
- v-model={row[column.key]}
1437
- props={{ ...input.props }}
1438
- on={{
1439
- ...input.on,
1440
- change: (e) => {
1441
- if (input.on && input.on.change)
1442
- input.on.change({
1443
- e,
1444
- row,
1445
- column,
1446
- $index,
1447
- input,
1448
- vm: this,
1449
- })
1450
- }
1451
- }}
1452
- />
1453
- </el-form-item>
1454
- )
1455
- else if (
1456
- input.showInputType === "click" ||
1457
- (!input.showInputType &&
1458
- this.formOptions.showInputType === "click")
1459
- )
1460
- return (
1461
- <el-form-item
1462
- prop={`data[${$index}].${column.key}`}
1463
- rules={input.rules}
1464
- >
1465
- <el-date-picker
1466
- style={{ width: "100%" }}
1467
- size={this.tableSize}
1468
- v-model={row[column.key]}
1469
- props={{ ...input.props }}
1470
- on={{
1471
- ...input.on,
1472
- change: (e) => {
1473
- if (input.rules && input.rules.length) {
1474
- this.$refs.elForm.validateField(
1475
- `data[${$index}].${column.key}`,
1476
- (err) => {
1477
- if (!err) {
1478
- this.handleColumnShow(row, column, input, false)
1479
- if (input.on && input.on.change)
1480
- input.on.change({
1481
- e,
1482
- row,
1483
- column,
1484
- $index,
1485
- input,
1486
- vm: this,
1487
- });
1488
- }
1489
- }
1490
- )
1491
- }
1492
- else {
1493
- this.handleColumnShow(row, column, input, false)
1494
- if (input.on && input.on.change) input.on.change({
1495
- e,
1496
- row,
1497
- column,
1498
- $index,
1499
- input,
1500
- vm: this,
1501
- });
1502
- }
1503
- }
1504
- }}
1505
- v-show={row[`${column.key}ShowByTableJsx`]}
1506
- />
1507
- <div
1508
- v-show={!row[`${column.key}ShowByTableJsx`]}
1509
- onClick={() => {
1510
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1511
- {/* if (
1512
- input.columnOptions &&
1513
- input.columnOptions.clickInputNoFoucs
1514
- )}
1515
- return;
1516
- this.$nextTick(() => {
1517
- row[`${column.key}RefByTableJsx`].focus();
1518
- }); */}
1519
- }}
1520
- >
1521
- {input.columnOptions && input.columnOptions.formatter
1522
- ? input.columnOptions.formatter({
1523
- row,
1524
- column,
1525
- $index,
1526
- input,
1527
- })
1528
- : row[column.key] || <i class="el-icon-edit"></i>}
1529
- </div>
1530
- </el-form-item>
1531
- )
1532
- else if (
1533
- input.showInputType === "doubleClick" ||
1534
- (!input.showInputType &&
1535
- this.formOptions.showInputType === "doubleClick")
1536
- )
1537
- return (
1538
- <el-form-item
1539
- prop={`data[${$index}].${column.key}`}
1540
- rules={input.rules}
1541
- >
1542
- <el-date-picker
1543
- style={{ width: "100%" }}
1544
- size={this.tableSize}
1545
- v-model={row[column.key]}
1546
- props={{ ...input.props }}
1547
- on={{
1548
- ...input.on,
1549
- change: (e) => {
1550
- if (input.rules && input.rules.length) {
1551
- console.log(
1552
- "validateField",
1553
- this.$refs.elForm,
1554
- this.$refs
1555
- )
1556
- this.$refs.elForm.validateField(
1557
- `data[${$index}].${column.key}`,
1558
- (err) => {
1559
- if (!err) {
1560
- this.handleColumnShow(row, column, input, false)
1561
- if (input.on && input.on.change)
1562
- input.on.change({
1563
- e,
1564
- row,
1565
- column,
1566
- $index,
1567
- input,
1568
- vm: this,
1569
- });
1570
- }
1571
- }
1572
- )
1573
- }
1574
- else {
1575
- this.handleColumnShow(row, column, input, false)
1576
- if (input.on && input.on.change) input.on.change({
1577
- e,
1578
- row,
1579
- column,
1580
- $index,
1581
- input,
1582
- vm: this,
1583
- })
1584
- }
1585
- }
1586
- }}
1587
- v-show={row[`${column.key}ShowByTableJsx`]}
1588
- />
1589
- <div
1590
- v-show={!row[`${column.key}ShowByTableJsx`]}
1591
- onDblclick={() => {
1592
- this.$set(row, `${column.key}ShowByTableJsx`, true);
1593
- {/* if (
1594
- input.columnOptions &&
1595
- input.columnOptions.clickInputNoFoucs
1596
- )}
1597
- return;
1598
- this.$nextTick(() => {
1599
- row[`${column.key}RefByTableJsx`].focus();
1600
- }); */}
1601
- }}
1602
- >
1603
- {input.columnOptions && input.columnOptions.formatter
1604
- ? input.columnOptions.formatter({
1605
- row,
1606
- column,
1607
- $index,
1608
- input,
1609
- })
1610
- : row[column.key] || <i class="el-icon-edit"></i>}
1611
- </div>
1612
- </el-form-item>
1613
- )
1614
- },
1615
- header: ({ $index, row }) => {
1616
- return slots.header
1617
- ? slots.header({
1618
- $index,
1619
- row,
1620
- column,
1621
- input,
1622
- })
1623
- : column.label;
1624
- }
1625
- }
1626
- },
1627
- customize: (column, input) => {
1628
- return {
1629
- default: ({ $index, row }) => {
1630
- return input.slotFn &&
1631
- input.slotFn({
1632
- $index,
1633
- row,
1634
- column,
1635
- input,
1636
- vm: this
1637
- });
1638
- },
1639
- header: ({ $index, row }) => {
1640
- return slots.header
1641
- ? slots.header({
1642
- $index,
1643
- row,
1644
- column,
1645
- input,
1646
- })
1647
- : column.label;
1648
- }
1649
- }
1650
- }
1651
- };
1652
- const input = column.input;
1653
- return inputEnum[input.type] && inputEnum[input.type](column, input);
1654
- },
1655
- dropdownCommand(v) {
1656
- console.log(v);
1657
- this.tableSize = v;
1658
- },
1659
- updateView() {
1660
- this.timeKey = Date.now();
1661
- },
1662
- spliceTableData(index, removeCount, ...items) {
1663
- this.__tableData.splice(index, removeCount, ...items);
1664
- this.updateView();
1665
- },
1666
-
1667
- renderTable() {
1668
- return (
1669
- <el-table
1670
- key={this.timeKey}
1671
- ref="elTableJsx"
1672
- data={this.__tableData}
1673
- props={{ ...this.$attrs, size: this.tableSize }}
1674
- on={{ ...this.$listeners }}
1675
- >
1676
- {this.__columns.map((item) => {
1677
- return (
1678
- !item.hide && (
1679
- <el-table-column
1680
- key={item.key}
1681
- label={item.label}
1682
- prop={item.key}
1683
- props={{ ...item.props }}
1684
- on={{ ...item.on }}
1685
- scopedSlots={this.handleColumnSlot(item)}
1686
- >
1687
- {this.handleColumnSlot(item)}
1688
- </el-table-column>
1689
- )
1690
- );
1691
- })}
1692
- </el-table>
1693
- );
1694
- },
1695
- },
1696
- render() {
1697
- console.log("render");
1698
- return (
1699
- <div class="elTableJsx">
1700
- {this.showHeader && (
1701
- <div class="header">
1702
- <div class="header-left">{this.$slots["header-left"]}</div>
1703
- <div class="header-right">
1704
- {this.$slots["header-right"]}
1705
- {this.showDensity && (
1706
- <el-dropdown trigger="click" onCommand={this.dropdownCommand}>
1707
- <el-tooltip
1708
- class="item"
1709
- effect="dark"
1710
- content="表格密度"
1711
- placement="top"
1712
- >
1713
- <i class="el-icon-d-caret icon-tool"></i>
1714
- </el-tooltip>
1715
-
1716
- <el-dropdown-menu slot="dropdown">
1717
- <el-dropdown-item command="medium">宽松</el-dropdown-item>
1718
- <el-dropdown-item command="small">中等</el-dropdown-item>
1719
- <el-dropdown-item command="mini">紧凑</el-dropdown-item>
1720
- </el-dropdown-menu>
1721
- </el-dropdown>
1722
- )}
1723
- {this.showColumnSettings && (
1724
- <el-popover
1725
- placement="top"
1726
- width="300"
1727
- value={this.visible}
1728
- onShow={() => {
1729
- this.visible = true;
1730
- }}
1731
- onHide={() => {
1732
- this.visible = false;
1733
- this.$refs.columnManagement1.dialogClose();
1734
- }}
1735
- >
1736
- {this.visible && (
1737
- <columnManagement
1738
- ref="columnManagement1"
1739
- columns={this.__columns}
1740
- setColumns={(v) => {
1741
- this.__columns = v;
1742
- this.timeKey = Date.now();
1743
- }}
1744
- />
1745
- )}
1746
-
1747
- <template slot="reference">
1748
- <el-tooltip
1749
- class="item"
1750
- effect="dark"
1751
- content="表格列设置"
1752
- placement="top"
1753
- >
1754
- <i class="el-icon-s-tools icon-tool" />
1755
- </el-tooltip>
1756
- </template>
1757
- </el-popover>
1758
- )}
1759
- </div>
1760
- </div>
1761
- )}
1762
- {this.formOptions.show ? (
1763
- <el-form
1764
- ref="elForm"
1765
- props={{
1766
- ...this.formOptions.props,
1767
- model: this.__tableForm,
1768
- }}
1769
- on={{ ...this.formOptions.on }}
1770
- >
1771
- {this.renderTable()}
1772
- </el-form>
1773
- ) : (
1774
- this.renderTable()
1775
- )}
1776
- </div>
1777
- );
1778
- },
1779
- };
1780
- </script>
1781
-
1782
- <style lang="less">
1783
- .elTableJsx {
1784
- .header {
1785
- display: flex;
1786
- justify-content: space-between;
1787
- align-items: center;
1788
- margin-bottom: 10px;
1789
-
1790
- .header-left {
1791
- flex: 1;
1792
- }
1793
-
1794
- .header-right {
1795
- flex: 1;
1796
- display: flex;
1797
- justify-content: flex-end;
1798
- align-items: center;
1799
-
1800
- .icon-tool {
1801
- font-size: 16px;
1802
- margin-left: 10px;
1803
- cursor: pointer;
1804
- }
1805
- }
1806
- }
1807
-
1808
- .el-table__row {
1809
- .el-form-item {
1810
- margin-bottom: 0;
1811
- // .el-form-item__content{
1812
- // .el-form-item__error{
1813
- // top: 50%;
1814
- // transform: translateY(-50%);
1815
- // left: 10px;
1816
- // }
1817
- // }
1818
- }
1819
-
1820
- .el-form-item.is-error {
1821
- padding-top: 0;
1822
- margin-bottom: 16px;
1823
- }
1824
- }
1825
- }
1826
- </style>