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 ...@@ -23,7 +23,7 @@ class SendPatchEdit extends Component
public $searchSelected = 'SNKEY'; public $searchSelected = 'SNKEY';
public $keyword = ''; public $keyword = '';
public $selectedPenddings = []; public $selectedPenddings = [];
public $serverkey = '', $showSearch = false, $searchInProgress = false, $resultsServerkey = []; public $serverkey = '', $showSearch = false, $searchInProgress = false, $resultsServerkey = [] ,$resultsServerkeyArr= [];
public $serverKeyWaitingSend = [], $serverKeySuccess = []; public $serverKeyWaitingSend = [], $serverKeySuccess = [];
protected $listeners = ['deletePatch', 'refreshComponent' => '$refresh' , 'sendPatch']; protected $listeners = ['deletePatch', 'refreshComponent' => '$refresh' , 'sendPatch'];
public function mount($editPid) public function mount($editPid)
...@@ -67,6 +67,7 @@ class SendPatchEdit extends Component ...@@ -67,6 +67,7 @@ class SendPatchEdit extends Component
{ {
if ($this->searchInProgress) { if ($this->searchInProgress) {
$this->reset('resultsServerkey'); $this->reset('resultsServerkey');
$this->reset('resultsServerkeyArr');
} }
$this->searchInProgress = true; $this->searchInProgress = true;
$query = ConfServerLicense::query(); $query = ConfServerLicense::query();
...@@ -87,6 +88,7 @@ class SendPatchEdit extends Component ...@@ -87,6 +88,7 @@ class SendPatchEdit extends Component
$query->where('OWNERTYPE', $this->selectedOwnerType); $query->where('OWNERTYPE', $this->selectedOwnerType);
} }
$this->resultsServerkey = $query->get(); $this->resultsServerkey = $query->get();
$this->resultsServerkeyArr = $query->get()->toArray();
$this->showSearch = true; $this->showSearch = true;
$this->searchInProgress = false; $this->searchInProgress = false;
} }
......
...@@ -3,6 +3,15 @@ ...@@ -3,6 +3,15 @@
serverKeySuccess: [], serverKeySuccess: [],
serverKeyWaitingSend: [], serverKeyWaitingSend: [],
loading: false, 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) { serverKeySelect(id, value) {
this.serverKeyWaitingSend.push({ id, value }); this.serverKeyWaitingSend.push({ id, value });
}, },
...@@ -71,7 +80,8 @@ ...@@ -71,7 +80,8 @@
<ul x-show="open" @click.away="open = false" <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"> 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" <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 Select All
</li> </li>
@forelse($resultsServerkey as $result) @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