mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-17 12:21:51 +08:00
Compare commits
2 Commits
develop
...
feature/sc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37381f6976 | ||
|
|
2ad891cc9c |
@@ -23,6 +23,7 @@ class StatuslabelsTransformer
|
||||
{
|
||||
$array = [
|
||||
'id' => (int) $statuslabel->id,
|
||||
'reorder_icon' => '<i class="fas fa-ellipsis-v"></i>',
|
||||
'name' => e($statuslabel->name),
|
||||
'type' => $statuslabel->getStatuslabelType(),
|
||||
'color' => ($statuslabel->color) ? e($statuslabel->color) : null,
|
||||
|
||||
@@ -21,6 +21,14 @@ class StatusLabelPresenter extends Presenter
|
||||
'switchable' => true,
|
||||
'title' => trans('general.id'),
|
||||
'visible' => false,
|
||||
],
|
||||
[
|
||||
'field' => 'reorder_icon',
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
'switchable' => false,
|
||||
'title' => trans('admin/custom_fields/general.reorder'),
|
||||
'visible' => true,
|
||||
], [
|
||||
'field' => 'name',
|
||||
'searchable' => true,
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('status_labels', function (Blueprint $table) {
|
||||
$table->tinyInteger('display_order')->nullable()->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('status_labels', function (Blueprint $table) {
|
||||
$table->dropColumn('display_order');
|
||||
});
|
||||
}
|
||||
};
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -35,6 +35,7 @@
|
||||
"select2": "4.0.13",
|
||||
"sheetjs": "^2.0.0",
|
||||
"signature_pad": "^4.2.0",
|
||||
"tablednd": "^1.0.5",
|
||||
"tableexport.jquery.plugin": "1.30.0",
|
||||
"tether": "^1.4.0",
|
||||
"webpack": "^5.94.0"
|
||||
@@ -10388,6 +10389,11 @@
|
||||
"acorn-node": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tablednd": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/tablednd/-/tablednd-1.0.5.tgz",
|
||||
"integrity": "sha512-iC230jusaekjzzAy0jigZLbzb7jKKnW9xiNiZ4W17p7y8AvBYf5KunyrIE3HwL1FhL2VEeogZtjP5VeBeIW4xg=="
|
||||
},
|
||||
"node_modules/tableexport.jquery.plugin": {
|
||||
"version": "1.30.0",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
"select2": "4.0.13",
|
||||
"sheetjs": "^2.0.0",
|
||||
"signature_pad": "^4.2.0",
|
||||
"tablednd": "^1.0.5",
|
||||
"tableexport.jquery.plugin": "1.30.0",
|
||||
"tether": "^1.4.0",
|
||||
"webpack": "^5.94.0"
|
||||
|
||||
2
public/css/dist/bootstrap-table.css
vendored
2
public/css/dist/bootstrap-table.css
vendored
@@ -2,6 +2,8 @@
|
||||
|
||||
.fix-sticky{position:fixed !important;overflow:hidden;z-index:100}.fix-sticky table thead{background:#fff}.fix-sticky table thead.thead-light{background:#e9ecef}.fix-sticky table thead.thead-dark{background:#212529}
|
||||
|
||||
.reorder-rows-on-drag-class td{background-color:#eee;box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset;-box-shadow:6px 4px 5px 1px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset}.reorder-rows-on-drag-class td:last-child{box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset;-box-shadow:0 9px 4px -4px #555,0 1px 0 #ccc inset,0 -1px 0 #ccc inset,-1px 0 0 #ccc inset}
|
||||
|
||||
/*
|
||||
* dragtable
|
||||
*
|
||||
|
||||
2316
public/js/dist/bootstrap-table.js
vendored
2316
public/js/dist/bootstrap-table.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -108,8 +108,8 @@
|
||||
"/css/dist/skins/skin-red.min.css": "/css/dist/skins/skin-red.min.css?id=44bf834f2110504a793dadec132a5898",
|
||||
"/css/dist/skins/skin-yellow-dark.min.css": "/css/dist/skins/skin-yellow-dark.min.css?id=393aaa7b368b0670fc42434c8cca7dc7",
|
||||
"/css/dist/skins/skin-yellow.min.css": "/css/dist/skins/skin-yellow.min.css?id=7b315b9612b8fde8f9c5b0ddb6bba690",
|
||||
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=393d720a0f9aba560094fbc8d3b0c0f0",
|
||||
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=9a35fafd5eb2a66d108b8b669e84f9e1",
|
||||
"/js/build/vendor.js": "/js/build/vendor.js?id=5269eb5a6beb74f03387c78938cf17b2",
|
||||
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=6660df122e24940d42d03c06775fec7b",
|
||||
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=bdb65484f5b26ceb5d8ca13331ff2749",
|
||||
"/js/dist/all.js": "/js/dist/all.js?id=e0a4b1a80b09333a460973137f39eab4"
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
<!-- drag handle -->
|
||||
<span class="handle">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
|
||||
@@ -98,14 +98,52 @@
|
||||
},
|
||||
formatNoMatches: function () {
|
||||
return '{{ trans('table.no_matching_records') }}';
|
||||
}
|
||||
},
|
||||
{{--onDrop: function (table, row) {--}}
|
||||
{{-- var rows = table.tBodies[0].rows;--}}
|
||||
{{-- var debugStr = "Row dropped was " + row.id + ". New order: ";--}}
|
||||
{{-- for (var i = 0; i < rows.length; i++) {--}}
|
||||
{{-- debugStr += rows[i].id + " ";--}}
|
||||
{{-- }--}}
|
||||
{{-- --}}
|
||||
{{-- $.ajax({--}}
|
||||
{{-- url: '{{ route('api.reorder') }}',--}}
|
||||
{{-- type: 'POST',--}}
|
||||
{{-- data: {--}}
|
||||
{{-- ids: rows.map(function (row) {--}}
|
||||
{{-- return row.id;--}}
|
||||
{{-- })--}}
|
||||
{{--},--}}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var debugStr = '';
|
||||
$('.snipe-table').on('reorder-row.bs.table', function (e, data, row){
|
||||
console.log('All Data:');
|
||||
console.log(data);
|
||||
console.log('Dragged Row Data:');
|
||||
console.dir(row);
|
||||
console.log('E:');
|
||||
console.dir(e);
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
debugStr += data[i].id + " ";
|
||||
}
|
||||
alert('re-order ID: ' + row.id + ' to ' + debugStr);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// function onReorderDrop (rows, row) {
|
||||
// var rows = table.tBodies[0].rows;
|
||||
// var debugStr = "Row dropped was " + row.id + ". New order: ";
|
||||
// for (var i = 0; i < rows.length; i++) {
|
||||
// debugStr += rows[i].id + " ";
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\StatusLabelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="statuslabelsTable"
|
||||
@@ -36,6 +37,8 @@
|
||||
data-show-export="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-refresh="true"
|
||||
data-use-row-attr-func="true"
|
||||
data-reorderable-rows="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="statuslabelsTable"
|
||||
|
||||
@@ -103,6 +103,7 @@ mix
|
||||
[
|
||||
"./node_modules/bootstrap-table/dist/bootstrap-table.css",
|
||||
"./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.css",
|
||||
"./node_modules/bootstrap-table/dist/extensions/reorder-rows/bootstrap-table-reorder-rows.css",
|
||||
"./resources/assets/css/dragtable.css",
|
||||
],
|
||||
"public/css/dist/bootstrap-table.css"
|
||||
@@ -148,8 +149,10 @@ mix
|
||||
'./node_modules/bootstrap-table/dist/extensions/export/bootstrap-table-export.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/cookie/bootstrap-table-cookie.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/sticky-header/bootstrap-table-sticky-header.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/reorder-rows/bootstrap-table-reorder-rows.js',
|
||||
'./node_modules/bootstrap-table/dist/extensions/addrbar/bootstrap-table-addrbar.js',
|
||||
'./resources/assets/js/extensions/jquery.base64.js',
|
||||
"./node_modules/tablednd/dist/jquery.tablednd.js",
|
||||
'./node_modules/tableexport.jquery.plugin/tableExport.min.js',
|
||||
'./node_modules/tableexport.jquery.plugin/libs/jsPDF/jspdf.umd.min.js',
|
||||
'./resources/assets/js/FileSaver.min.js',
|
||||
|
||||
Reference in New Issue
Block a user