@leevan/jtui 2.0.53 → 2.0.54-beta.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.
- 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 +15 -29
- package/packages/jt-table/components/tableColumn.vue +6 -3
- package/packages/jt-table/data2.js +10918 -640
- package/packages/jt-table/index.vue +17 -19
package/package.json
CHANGED
|
@@ -117,6 +117,14 @@ export default {
|
|
|
117
117
|
type: {
|
|
118
118
|
type: String,
|
|
119
119
|
default: 'text'
|
|
120
|
+
},
|
|
121
|
+
row: {
|
|
122
|
+
type: Object,
|
|
123
|
+
default: null
|
|
124
|
+
},
|
|
125
|
+
prop: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: ''
|
|
120
128
|
}
|
|
121
129
|
},
|
|
122
130
|
data() {
|
|
@@ -152,55 +160,33 @@ export default {
|
|
|
152
160
|
this.doComplete();
|
|
153
161
|
},
|
|
154
162
|
doComplete() {
|
|
163
|
+
if (this.row && this.prop) {
|
|
164
|
+
if (!(this.prop in this.row)) {
|
|
165
|
+
this.$set(this.row, this.prop, this.currentValue);
|
|
166
|
+
} else {
|
|
167
|
+
this.row[this.prop] = this.currentValue;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
155
170
|
this.$emit('input', this.currentValue);
|
|
156
171
|
this.closeEdit();
|
|
157
172
|
},
|
|
158
173
|
closeEdit() {
|
|
159
174
|
try {
|
|
160
|
-
console.log('EditInput closeEdit, start finding VxeTable...');
|
|
161
175
|
let vm = this.$parent;
|
|
162
176
|
let count = 0;
|
|
163
177
|
while (vm && count < 30) {
|
|
164
178
|
const componentName = vm.$options && vm.$options.name;
|
|
165
|
-
|
|
166
179
|
if (componentName === 'VxeTable' || componentName === 'VxeTable') {
|
|
167
|
-
console.log('Found VxeTable component!');
|
|
168
|
-
console.log('vm.$xegrid:', vm.$xegrid);
|
|
169
180
|
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
181
|
if (typeof vm.$xegrid._clearActived === 'function') {
|
|
176
182
|
vm.$xegrid._clearActived();
|
|
177
183
|
return;
|
|
178
184
|
}
|
|
179
|
-
if (typeof vm.$xegrid.closeEdit === 'function') {
|
|
180
|
-
vm.$xegrid.closeEdit();
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
185
|
}
|
|
184
186
|
if (typeof vm._clearActived === 'function') {
|
|
185
187
|
vm._clearActived();
|
|
186
188
|
return;
|
|
187
189
|
}
|
|
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
190
|
}
|
|
205
191
|
vm = vm.$parent;
|
|
206
192
|
count++;
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
62
62
|
v-model="row[subSubItem.prop]"
|
|
63
63
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
64
|
-
:
|
|
64
|
+
:row="row"
|
|
65
|
+
:prop="subSubItem.prop"
|
|
65
66
|
/>
|
|
66
67
|
</template>
|
|
67
68
|
</vxe-table-column>
|
|
@@ -113,7 +114,8 @@
|
|
|
113
114
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
114
115
|
v-model="row[subItem.prop]"
|
|
115
116
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
116
|
-
:
|
|
117
|
+
:row="row"
|
|
118
|
+
:prop="subItem.prop"
|
|
117
119
|
/>
|
|
118
120
|
</template>
|
|
119
121
|
</vxe-table-column>
|
|
@@ -166,7 +168,8 @@
|
|
|
166
168
|
v-else-if="item && item.edit && item.edit.name == '$input'"
|
|
167
169
|
v-model="row[item.prop]"
|
|
168
170
|
:type="(item.edit.props && item.edit.props.type) || 'text'"
|
|
169
|
-
:
|
|
171
|
+
:row="row"
|
|
172
|
+
:prop="item.prop"
|
|
170
173
|
/>
|
|
171
174
|
</template>
|
|
172
175
|
</vxe-table-column>
|