Loading module/Oscar/src/Oscar/Controller/ProjectGrantController.php +1 −0 Original line number Diff line number Diff line Loading @@ -2857,6 +2857,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif // Type de filtre $filters = $this->getProjectGrantService()->getFiltersAvailables(); $sorts = [ 'hit' => 'Pertinence de la recherche (textuelle)', 'dateUpdated' => 'Date de mise à jour', Loading ui/src/ActivityForm.js +6 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,12 @@ elementsDom.forEach(elem => { let label = elem.dataset.label; let type = elem.dataset.type; let params = JSON.parse(atob(elem.dataset.params)); let defaultValue = JSON.parse(atob(elem.dataset.value)); let defaultValue = null; try { defaultValue = JSON.parse(atob(elem.dataset.value)); } catch (err) { console.log("Pas de valeur"); } let id = elem.id; let instance = createApp(OscarFormVite, { Loading ui/src/ActivityList.js +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,9 @@ import money from "./utils/MoneyFilter.js"; import {oscarText} from "./utils/OscarText.js"; import 'vue-select/dist/vue-select.css'; import ActivityTypeItem from "./components/ActivityTypeItem.vue"; import PrimeVue from "primevue/config"; import Aura from '@primeuix/themes/aura'; let elemID = "#activity-list"; Loading Loading @@ -65,5 +68,13 @@ app.config.globalProperties.$filters = { return money.money(amount); } }; app.use(PrimeVue, { theme: { preset: Aura } }); app.component('activity-type-item', ActivityTypeItem); app.mount(elemID); No newline at end of file ui/src/components/activitysearch/ActivitySearchFilterGeneric.vue +1 −1 Original line number Diff line number Diff line <template> <div class="card"> <h3 class="card-subtitle">{{ filter.label }}</h3> <h3 class="card-subtitle">{{ filter.label }} (generic)</h3> <h2 class="card-title"> <span> <i class="icon-tags"></i> Loading ui/src/components/activitysearch/ActivitySearchFilterGenericListRest.vue 0 → 100644 +85 −0 Original line number Diff line number Diff line <template> <div class="card"> <h3 class="card-subtitle">{{ filter.label }} (liste REST)</h3> <h2 class="card-title"> <span> <i class="icon-doc-text"></i> </span> <span style="flex: 1"> <input type="hidden" :value="filter.raw" @change="handlerChangeRaw" /> <AutoComplete optionLabel="label" dropdown v-model="restResult" :suggestions="restItems" @complete="handlerSearch" /> </span> <nav> <button class="btn btn-danger btn-sm" @click="$emit('remove')"> <i class="icon-trash"></i>Retirer </button> </nav> </h2> </div> </template> <script> import AutoComplete from "primevue/autocomplete"; import AxiosOscar from "../../utils/AxiosOscar.js"; export default { components: {AutoComplete}, props: { filter: {type: Object, required: true}, }, data(){ return { value1: null, restResult: null, restItems: [] } }, watch: { restResult(newValue, oldValue){ if( newValue !== oldValue ){ if( newValue === "" || newValue.hasOwnProperty('value') ){ this.value1 = newValue === "" ? "" : newValue.value; this.$emit('filter-update', { value1: this.value1, value2: newValue.label }); } } } }, methods: { handlerSelectValue1() { this.$emit('filter-update', {value1: this.value1}); }, handlerSearch(evt){ if( evt.query && evt.query.length >= 2 ){ AxiosOscar.get(this.filter.params.rest + evt.query).then(ok => { let items = []; ok.data.datas.forEach(i => { items.push({ value: i.id, label: i.label }); }); this.restItems = items; }) } } }, mounted() { if( this.filter.value1 && this.filter.value2 ){ this.value1 = this.filter.value1; let selected = { value: parseInt(this.filter.value1), label: this.filter.value2 }; this.restItems = [selected]; this.restResult = selected; } } } </script> Loading
module/Oscar/src/Oscar/Controller/ProjectGrantController.php +1 −0 Original line number Diff line number Diff line Loading @@ -2857,6 +2857,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif // Type de filtre $filters = $this->getProjectGrantService()->getFiltersAvailables(); $sorts = [ 'hit' => 'Pertinence de la recherche (textuelle)', 'dateUpdated' => 'Date de mise à jour', Loading
ui/src/ActivityForm.js +6 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,12 @@ elementsDom.forEach(elem => { let label = elem.dataset.label; let type = elem.dataset.type; let params = JSON.parse(atob(elem.dataset.params)); let defaultValue = JSON.parse(atob(elem.dataset.value)); let defaultValue = null; try { defaultValue = JSON.parse(atob(elem.dataset.value)); } catch (err) { console.log("Pas de valeur"); } let id = elem.id; let instance = createApp(OscarFormVite, { Loading
ui/src/ActivityList.js +11 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,9 @@ import money from "./utils/MoneyFilter.js"; import {oscarText} from "./utils/OscarText.js"; import 'vue-select/dist/vue-select.css'; import ActivityTypeItem from "./components/ActivityTypeItem.vue"; import PrimeVue from "primevue/config"; import Aura from '@primeuix/themes/aura'; let elemID = "#activity-list"; Loading Loading @@ -65,5 +68,13 @@ app.config.globalProperties.$filters = { return money.money(amount); } }; app.use(PrimeVue, { theme: { preset: Aura } }); app.component('activity-type-item', ActivityTypeItem); app.mount(elemID); No newline at end of file
ui/src/components/activitysearch/ActivitySearchFilterGeneric.vue +1 −1 Original line number Diff line number Diff line <template> <div class="card"> <h3 class="card-subtitle">{{ filter.label }}</h3> <h3 class="card-subtitle">{{ filter.label }} (generic)</h3> <h2 class="card-title"> <span> <i class="icon-tags"></i> Loading
ui/src/components/activitysearch/ActivitySearchFilterGenericListRest.vue 0 → 100644 +85 −0 Original line number Diff line number Diff line <template> <div class="card"> <h3 class="card-subtitle">{{ filter.label }} (liste REST)</h3> <h2 class="card-title"> <span> <i class="icon-doc-text"></i> </span> <span style="flex: 1"> <input type="hidden" :value="filter.raw" @change="handlerChangeRaw" /> <AutoComplete optionLabel="label" dropdown v-model="restResult" :suggestions="restItems" @complete="handlerSearch" /> </span> <nav> <button class="btn btn-danger btn-sm" @click="$emit('remove')"> <i class="icon-trash"></i>Retirer </button> </nav> </h2> </div> </template> <script> import AutoComplete from "primevue/autocomplete"; import AxiosOscar from "../../utils/AxiosOscar.js"; export default { components: {AutoComplete}, props: { filter: {type: Object, required: true}, }, data(){ return { value1: null, restResult: null, restItems: [] } }, watch: { restResult(newValue, oldValue){ if( newValue !== oldValue ){ if( newValue === "" || newValue.hasOwnProperty('value') ){ this.value1 = newValue === "" ? "" : newValue.value; this.$emit('filter-update', { value1: this.value1, value2: newValue.label }); } } } }, methods: { handlerSelectValue1() { this.$emit('filter-update', {value1: this.value1}); }, handlerSearch(evt){ if( evt.query && evt.query.length >= 2 ){ AxiosOscar.get(this.filter.params.rest + evt.query).then(ok => { let items = []; ok.data.datas.forEach(i => { items.push({ value: i.id, label: i.label }); }); this.restItems = items; }) } } }, mounted() { if( this.filter.value1 && this.filter.value2 ){ this.value1 = this.filter.value1; let selected = { value: parseInt(this.filter.value1), label: this.filter.value2 }; this.restItems = [selected]; this.restResult = selected; } } } </script>