vue_crud 0.1.10.8.2 → 0.1.10.8.3
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.
- checksums.yaml +4 -4
- data/lib/vue_crud/version.rb +1 -1
- data/vendor/assets/javascripts/vue_crud.js +33 -34
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f23422603c2de4a79d19d63765cb0243d6bd918d
|
4
|
+
data.tar.gz: f0e093a5e21a57b75a4d6b3a4e3af187cf7f3448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0476af27959e5248c3c54ffb1eee2d557071392c0976221939b629622a1b9cc289e44cf8e8ff3de6acf25fa7a6be5ecbf82414c35bf4be20bc029d3e440f5374
|
7
|
+
data.tar.gz: b03650b87f112cb25c019a042f3045e8312f2ab225d3b83f025b13cb00424bcc490e96c12fafbb3ff40ba35892dfba3326c5ac7f9b735ad5f786856539842061
|
data/lib/vue_crud/version.rb
CHANGED
@@ -116,8 +116,8 @@ function vueCRUD_init(params = {}) {
|
|
116
116
|
}
|
117
117
|
},
|
118
118
|
mounted: function() {
|
119
|
-
event_hub.$on('update_error', function(
|
120
|
-
this.
|
119
|
+
event_hub.$on('update_error', function(error) {
|
120
|
+
this.error = error;
|
121
121
|
}.bind(this));
|
122
122
|
event_hub.$on('update_action_name', function(action_name) {
|
123
123
|
this.action_name = action_name;
|
@@ -177,14 +177,13 @@ function vueCRUD_init(params = {}) {
|
|
177
177
|
observeChanges: true,
|
178
178
|
transition: 'fade down',
|
179
179
|
onShow: function() {
|
180
|
-
|
181
|
-
$('.needRefresh').froalaEditor('reset');
|
180
|
+
// $('.needRefresh').froalaEditor('reset');
|
182
181
|
$(this).find('select.ui.dropdown').dropdown();
|
183
182
|
$(this).find('.ui.checkbox').checkbox();
|
184
183
|
if(typeof modalOpen !== "undefined") modalOpen(this);
|
185
184
|
},
|
186
185
|
onVisible: function() {
|
187
|
-
$('.needRefresh').froalaEditor('refresh');
|
186
|
+
// $('.needRefresh').froalaEditor('refresh');
|
188
187
|
},
|
189
188
|
onHide: function() {
|
190
189
|
event_hub.$emit('cancel_customMode');
|
@@ -264,26 +263,28 @@ function vueCRUD_init(params = {}) {
|
|
264
263
|
}.bind(this));
|
265
264
|
event_hub.$emit('openModal');
|
266
265
|
},
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
266
|
+
restoreModel: function () {
|
267
|
+
var that = this;
|
268
|
+
$.ajax({
|
269
|
+
method: 'POST',
|
270
|
+
data: JSON.stringify(that.model),
|
271
|
+
url: that.info.url_prefix + options.suffix + location.search,
|
272
|
+
success: function(res) {
|
273
|
+
that.model = res;
|
274
|
+
that.deleteMode = false;
|
275
|
+
that.is_deleted = false;
|
276
|
+
that.is_success = true;
|
277
|
+
sleep(1500).then(() => {
|
278
|
+
that.is_success = false;
|
279
|
+
});
|
280
|
+
},
|
281
|
+
error: function(res) {
|
282
|
+
that.is_deleted = false;
|
283
|
+
that.is_restore_failed = true;
|
284
|
+
alert('復原失敗,請記錄資料並重新建立');
|
285
|
+
}
|
286
|
+
});
|
287
|
+
},
|
287
288
|
// restoreModel: function() {
|
288
289
|
// if(confirm("Are you sure?") == true) {
|
289
290
|
// event_hub.$emit('restoreCreate', this.model);
|
@@ -295,12 +296,10 @@ function vueCRUD_init(params = {}) {
|
|
295
296
|
deleteModel: function () {
|
296
297
|
var that = this;
|
297
298
|
that.deleteMode = true;
|
298
|
-
var id = that.model.ID || that.model.id;
|
299
|
-
|
300
299
|
if(confirm("Are you sure?") == true) {
|
301
300
|
$.ajax({
|
302
301
|
method: 'DELETE',
|
303
|
-
url: that.info.url_prefix + '/' +
|
302
|
+
url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
|
304
303
|
success: function(res) {
|
305
304
|
that.is_deleted = true;
|
306
305
|
// event_hub.$on('toggleRestoreSuccess', function() {
|
@@ -328,12 +327,12 @@ function vueCRUD_init(params = {}) {
|
|
328
327
|
},
|
329
328
|
updateModel: function() {
|
330
329
|
var that = this;
|
331
|
-
var id = that.model.ID || that.model.id;
|
332
330
|
$.ajax({
|
333
331
|
method: 'PATCH',
|
334
|
-
data:
|
335
|
-
url: that.info.url_prefix + '/' +
|
332
|
+
data: JSON.stringify(that.model),
|
333
|
+
url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
|
336
334
|
beforeSend: function() {
|
335
|
+
console.log(JSON.stringify(that.model));
|
337
336
|
event_hub.$emit('dimmerOn');
|
338
337
|
$('.progress-bar').css('width', '0');
|
339
338
|
},
|
@@ -488,7 +487,7 @@ function vueCRUD_init(params = {}) {
|
|
488
487
|
// var that = this;
|
489
488
|
// $.ajax({
|
490
489
|
// method: 'POST',
|
491
|
-
// data:
|
490
|
+
// data: JSON.stringify(that.model),
|
492
491
|
// url: that.info.url_prefix + options.suffix + location.search,
|
493
492
|
// success: function(res) {
|
494
493
|
// event_hub.$emit('toggleRestoreSuccess');
|
@@ -502,10 +501,10 @@ function vueCRUD_init(params = {}) {
|
|
502
501
|
var that = this;
|
503
502
|
$.ajax({
|
504
503
|
method: 'POST',
|
505
|
-
data:
|
504
|
+
data: JSON.stringify(that.model),
|
506
505
|
url: that.info.url_prefix + options.suffix + location.search,
|
507
506
|
beforeSend: function() {
|
508
|
-
console.log(
|
507
|
+
console.log(JSON.stringify(that.model));
|
509
508
|
event_hub.$emit('dimmerOn');
|
510
509
|
$('.progress-bar').css('width', '0');
|
511
510
|
},
|