PMCORE-3312

This commit is contained in:
Henry Jordan
2021-09-13 20:00:12 +00:00
parent bedd9b0ca6
commit 2184739741
2 changed files with 20 additions and 20 deletions

View File

@@ -35,7 +35,7 @@
<b-form-group>
<b-form-checkbox-group
v-model="localSelected"
:options="results"
:options="options"
value-field="key"
text-field="value"
name="flavour-2a"
@@ -60,19 +60,17 @@
<script>
export default {
name: "ProcessPopover",
props: ["target"],
props: ["target", "options"],
data() {
return {
options: [],
timeCounter:"",
text: "",
results: [],
allColumns: false,
localSelected: [],
selected: [],
};
},
mounted() {
this.results = this.options;
this.localSelected = this.selected;
},
methods: {
@@ -82,7 +80,6 @@ export default {
*/
setOptions(options) {
this.options = options;
this.results = options;
},
/**
* Setter the selected options
@@ -118,29 +115,24 @@ export default {
* Search in the column name
*/
search() {
let txt = this.text.toLowerCase(),
val,
opts = [];
opts = _.filter(this.options, function (o) {
val = o.value.toLowerCase();
return val.search(txt) != -1;
});
this.results = opts;
let that = this;
clearTimeout(this.timeCounter);
this.timeCounter = setTimeout(()=>{
that.$emit("onChange", this.text.toLowerCase())
}, 500);
},
/**
* Toogle all options in popover
*/
toogleAllColumns() {
let res = [];
if (this.allColumns) {
_.each(this.options, function (o) {
res.push(o.key);
});
}
this.selected = res;
this.localSelected = res;
},
/**
* Handler when change options event