Commit 61193e4d authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

issue select all send patch

parent 78e85313
......@@ -23,7 +23,7 @@ class SendPatchEdit extends Component
public $searchSelected = 'SNKEY';
public $keyword = '';
public $selectedPenddings = [];
public $serverkey = '', $showSearch = false, $searchInProgress = false, $resultsServerkey = [];
public $serverkey = '', $showSearch = false, $searchInProgress = false, $resultsServerkey = [] ,$resultsServerkeyArr= [];
public $serverKeyWaitingSend = [], $serverKeySuccess = [];
protected $listeners = ['deletePatch', 'refreshComponent' => '$refresh' , 'sendPatch'];
public function mount($editPid)
......@@ -67,6 +67,7 @@ class SendPatchEdit extends Component
{
if ($this->searchInProgress) {
$this->reset('resultsServerkey');
$this->reset('resultsServerkeyArr');
}
$this->searchInProgress = true;
$query = ConfServerLicense::query();
......@@ -87,6 +88,7 @@ class SendPatchEdit extends Component
$query->where('OWNERTYPE', $this->selectedOwnerType);
}
$this->resultsServerkey = $query->get();
$this->resultsServerkeyArr = $query->get()->toArray();
$this->showSearch = true;
$this->searchInProgress = false;
}
......
......@@ -3,6 +3,15 @@
serverKeySuccess: [],
serverKeyWaitingSend: [],
loading: false,
allKeys: @entangle('resultsServerkeyArr'),
serverKeySelectAll() {
console.log('test');
this.allKeys.forEach(key => {
if (!this.serverKeyWaitingSend.some(item => item.id === key.ID)) {
this.serverKeyWaitingSend.push({ id: key.ID, value: key.SNKEY });
}
});
},
serverKeySelect(id, value) {
this.serverKeyWaitingSend.push({ id, value });
},
......@@ -71,7 +80,8 @@
<ul x-show="open" @click.away="open = false"
class="absolute left-0 right-0 border border-gray-200 rounded-md max-h-64 overflow-auto z-50 bg-white">
<li class="p-2 bg-gray-200 hover:bg-gray-300 cursor-pointer font-semibold"
wire:click="selectAllResults">
{{-- wire:click="selectAllResults" --}}
@click="serverKeySelectAll()">
Select All
</li>
@forelse($resultsServerkey as $result)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment