vue_crud 0.1.10.8 → 0.1.10.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/vue_crud/version.rb +1 -1
- data/vendor/.DS_Store +0 -0
- data/vendor/assets/.DS_Store +0 -0
- data/vendor/assets/javascripts/vue_crud.js +53 -34
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8c349fa0bacbe31044a9fcc06ff8dd89d3fb2d5
|
4
|
+
data.tar.gz: 8ef1d77f86d941020ed6a7c5805ae11dd1df0611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3deebc20543bc55bf122a6775bcc0eb09f94e374ecf411edbef16bf13aca164723adfe3ccaa85f5e99a9cdd147f5d2b6e0491ab25688505039e26e393058d43f
|
7
|
+
data.tar.gz: db220e80e754a81a8fd042bf478b418ce3fba0a6706e4ac710664e41587309585a7dace10acc9b4f7349875973a6f95a2c767fe6bcf5f6ece41c906ac2e06329
|
data/.DS_Store
CHANGED
Binary file
|
data/lib/.DS_Store
CHANGED
Binary file
|
data/lib/vue_crud/version.rb
CHANGED
data/vendor/.DS_Store
CHANGED
Binary file
|
data/vendor/assets/.DS_Store
CHANGED
Binary file
|
@@ -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,23 +263,43 @@ function vueCRUD_init(params = {}) {
|
|
264
263
|
}.bind(this));
|
265
264
|
event_hub.$emit('openModal');
|
266
265
|
},
|
267
|
-
restoreModel: function() {
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
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
|
+
});
|
274
287
|
},
|
288
|
+
// restoreModel: function() {
|
289
|
+
// if(confirm("Are you sure?") == true) {
|
290
|
+
// event_hub.$emit('restoreCreate', this.model);
|
291
|
+
// }
|
292
|
+
// else {
|
293
|
+
//
|
294
|
+
// }
|
295
|
+
// },
|
275
296
|
deleteModel: function () {
|
276
297
|
var that = this;
|
277
298
|
that.deleteMode = true;
|
278
|
-
var id = that.model.ID || that.model.id;
|
279
|
-
|
280
299
|
if(confirm("Are you sure?") == true) {
|
281
300
|
$.ajax({
|
282
301
|
method: 'DELETE',
|
283
|
-
url: that.info.url_prefix + '/' +
|
302
|
+
url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
|
284
303
|
success: function(res) {
|
285
304
|
that.is_deleted = true;
|
286
305
|
event_hub.$on('toggleRestoreSuccess', function() {
|
@@ -308,12 +327,12 @@ function vueCRUD_init(params = {}) {
|
|
308
327
|
},
|
309
328
|
updateModel: function() {
|
310
329
|
var that = this;
|
311
|
-
var id = that.model.ID || that.model.id;
|
312
330
|
$.ajax({
|
313
331
|
method: 'PATCH',
|
314
|
-
data:
|
315
|
-
url: that.info.url_prefix + '/' +
|
332
|
+
data: JSON.stringify(that.model),
|
333
|
+
url: that.info.url_prefix + '/' + that.model.ID + options.suffix + location.search,
|
316
334
|
beforeSend: function() {
|
335
|
+
console.log(JSON.stringify(that.model));
|
317
336
|
event_hub.$emit('dimmerOn');
|
318
337
|
$('.progress-bar').css('width', '0');
|
319
338
|
},
|
@@ -464,28 +483,28 @@ function vueCRUD_init(params = {}) {
|
|
464
483
|
this.currentPage = idx;
|
465
484
|
updateQueryStringParam('p', this.currentPage);
|
466
485
|
},
|
467
|
-
restoreModel: function () {
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
},
|
486
|
+
// restoreModel: function () {
|
487
|
+
// var that = this;
|
488
|
+
// $.ajax({
|
489
|
+
// method: 'POST',
|
490
|
+
// data: JSON.stringify(that.model),
|
491
|
+
// url: that.info.url_prefix + options.suffix + location.search,
|
492
|
+
// success: function(res) {
|
493
|
+
// event_hub.$emit('toggleRestoreSuccess');
|
494
|
+
// },
|
495
|
+
// error: function(res) {
|
496
|
+
// event_hub.$emit('toggleRestoreFail');
|
497
|
+
// }
|
498
|
+
// });
|
499
|
+
// },
|
481
500
|
createModel: function () {
|
482
501
|
var that = this;
|
483
502
|
$.ajax({
|
484
503
|
method: 'POST',
|
485
|
-
data:
|
504
|
+
data: JSON.stringify(that.model),
|
486
505
|
url: that.info.url_prefix + options.suffix + location.search,
|
487
506
|
beforeSend: function() {
|
488
|
-
console.log(
|
507
|
+
console.log(JSON.stringify(that.model));
|
489
508
|
event_hub.$emit('dimmerOn');
|
490
509
|
$('.progress-bar').css('width', '0');
|
491
510
|
},
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vue_crud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.10.8
|
4
|
+
version: 0.1.10.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Donald Chiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|