Merged in feature/PMCORE-3312 (pull request #8127)

PMCORE-3312

Approved-by: Rodrigo Quelca
This commit is contained in:
Henry Jonathan Quispe Quispe
2021-09-14 14:30:44 +00:00
committed by Julio Cesar Laura Avendaño
3 changed files with 24 additions and 23 deletions

View File

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

View File

@@ -11,6 +11,7 @@
/> />
<ProcessPopover <ProcessPopover
:options="optionsProcesses" :options="optionsProcesses"
@onChange="onChangeSearchPopover"
target="pm-task-process" target="pm-task-process"
ref="pm-task-process" ref="pm-task-process"
@onUpdateColumnSettings="onUpdateColumnSettings" @onUpdateColumnSettings="onUpdateColumnSettings"
@@ -183,11 +184,12 @@ export default {
}, },
/** /**
* Get Processes form API * Get Processes form API
* @param {string} query - Text value in search popover
*/ */
getProcesses() { getProcesses(query) {
let that = this; let that = this;
Api.filters Api.filters
.processList("") .processList(query || "")
.then((response) => { .then((response) => {
that.formatDataProcesses(response.data); that.formatDataProcesses(response.data);
that.changeOption({ that.changeOption({
@@ -334,6 +336,13 @@ export default {
id: 0, id: 0,
}); });
}, },
/**
* Event handler change input search popover
* @param {string} query - value in popover search input
*/
onChangeSearchPopover(query){
this.getProcesses(query);
}
}, },
}; };
</script> </script>

View File

@@ -36,6 +36,7 @@ import VueChartLvZero from "./VueChartLvZero.vue";
import VueChartLvOne from "./VueChartLvOne.vue"; import VueChartLvOne from "./VueChartLvOne.vue";
import VueChartLvTwo from "./VueChartLvTwo.vue"; import VueChartLvTwo from "./VueChartLvTwo.vue";
import VueChartLvThree from "./VueChartLvThree.vue"; import VueChartLvThree from "./VueChartLvThree.vue";
import _ from "lodash";
export default { export default {
name: "VueCharts", name: "VueCharts",
@@ -51,9 +52,9 @@ export default {
let that = this; let that = this;
return { return {
level: 0, level: 0,
key1: 1, key1: _.random(0,100),
key2: 1, key2: _.random(0,100),
key3: 1, key3: _.random(0,100),
data: [], data: [],
settingsBreadCrumbs: [ settingsBreadCrumbs: [
{ {