@leevan/jtui 2.0.53 → 2.0.54
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.
- package/examples/tableTest/table-ptbg.vue +6 -1
- package/lib/jtui.common.js +53 -85
- package/lib/jtui.umd.js +53 -85
- package/lib/jtui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/jt-table/components/edit-components/EditInput.vue +0 -29
- package/packages/jt-table/components/tableColumn.vue +13 -6
- package/packages/jt-table/data2.js +10918 -640
- package/packages/jt-table/index.vue +17 -19
package/package.json
CHANGED
|
@@ -157,50 +157,21 @@ export default {
|
|
|
157
157
|
},
|
|
158
158
|
closeEdit() {
|
|
159
159
|
try {
|
|
160
|
-
console.log('EditInput closeEdit, start finding VxeTable...');
|
|
161
160
|
let vm = this.$parent;
|
|
162
161
|
let count = 0;
|
|
163
162
|
while (vm && count < 30) {
|
|
164
163
|
const componentName = vm.$options && vm.$options.name;
|
|
165
|
-
|
|
166
164
|
if (componentName === 'VxeTable' || componentName === 'VxeTable') {
|
|
167
|
-
console.log('Found VxeTable component!');
|
|
168
|
-
console.log('vm.$xegrid:', vm.$xegrid);
|
|
169
165
|
if (vm.$xegrid) {
|
|
170
|
-
console.log('Methods on $xegrid:', Object.keys(vm.$xegrid));
|
|
171
|
-
if (typeof vm.$xegrid.clearEdit === 'function') {
|
|
172
|
-
vm.$xegrid.clearEdit();
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
166
|
if (typeof vm.$xegrid._clearActived === 'function') {
|
|
176
167
|
vm.$xegrid._clearActived();
|
|
177
168
|
return;
|
|
178
169
|
}
|
|
179
|
-
if (typeof vm.$xegrid.closeEdit === 'function') {
|
|
180
|
-
vm.$xegrid.closeEdit();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
170
|
}
|
|
184
171
|
if (typeof vm._clearActived === 'function') {
|
|
185
172
|
vm._clearActived();
|
|
186
173
|
return;
|
|
187
174
|
}
|
|
188
|
-
if (typeof vm.$xegrid && typeof vm.$xegrid._clearActived === 'function') {
|
|
189
|
-
vm.$xegrid._clearActived();
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
console.log('Trying all methods on VxeTable vm:', Object.keys(vm));
|
|
193
|
-
for (let key of Object.keys(vm)) {
|
|
194
|
-
if (typeof vm[key] === 'function' && (key.toLowerCase().includes('clear') || key.toLowerCase().includes('close') || key.toLowerCase().includes('edit'))) {
|
|
195
|
-
console.log('Found potential method:', key);
|
|
196
|
-
try {
|
|
197
|
-
vm[key]();
|
|
198
|
-
return;
|
|
199
|
-
} catch (e) {
|
|
200
|
-
console.log('Tried', key, 'but failed:', e);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
175
|
}
|
|
205
176
|
vm = vm.$parent;
|
|
206
177
|
count++;
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
<EditInput
|
|
61
61
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
62
|
-
|
|
62
|
+
:value="row[subSubItem.prop]"
|
|
63
|
+
@input="(val) => handleInputChange(val, row, subSubItem.prop)"
|
|
63
64
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
64
|
-
:table-instance="vxeTableInstance"
|
|
65
65
|
/>
|
|
66
66
|
</template>
|
|
67
67
|
</vxe-table-column>
|
|
@@ -111,9 +111,9 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
<EditInput
|
|
113
113
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
114
|
-
|
|
114
|
+
:value="row[subItem.prop]"
|
|
115
|
+
@input="(val) => handleInputChange(val, row, subItem.prop)"
|
|
115
116
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
116
|
-
:table-instance="vxeTableInstance"
|
|
117
117
|
/>
|
|
118
118
|
</template>
|
|
119
119
|
</vxe-table-column>
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
</div>
|
|
165
165
|
<EditInput
|
|
166
166
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
167
|
-
|
|
167
|
+
:value="row[item.prop]"
|
|
168
|
+
@input="(val) => handleInputChange(val, row, item.prop)"
|
|
168
169
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
169
|
-
:table-instance="vxeTableInstance"
|
|
170
170
|
/>
|
|
171
171
|
</template>
|
|
172
172
|
</vxe-table-column>
|
|
@@ -261,6 +261,13 @@ export default {
|
|
|
261
261
|
const findItem = this.item.edit.options.find(op => op.value === value);
|
|
262
262
|
return findItem ? findItem.label : (value || '请选择');
|
|
263
263
|
},
|
|
264
|
+
handleInputChange(val, row, prop) {
|
|
265
|
+
if (!(prop in row)) {
|
|
266
|
+
this.$set(row, prop, val);
|
|
267
|
+
} else {
|
|
268
|
+
row[prop] = val;
|
|
269
|
+
}
|
|
270
|
+
},
|
|
264
271
|
toggleDropdown() {
|
|
265
272
|
this.isOpen = !this.isOpen;
|
|
266
273
|
},
|