Merge branch '__SocialWorkType_finish' into 111_exports_suite

This commit is contained in:
Mathieu Jaumotte 2022-09-19 09:05:39 +02:00
commit d907357748
6 changed files with 18 additions and 18 deletions

View File

@ -23,7 +23,7 @@
{% block js %} {% block js %}
{{ encore_entry_script_tags('page_export') }} {{ encore_entry_script_tags('page_export') }}
{% if export_alias == 'count_social_work_actions' %} {% if export_alias == 'count_social_work_actions' %}
{{ encore_entry_script_tags('vue_form_action_goal_result') }} {{ encore_entry_script_tags('vue_export_action_goal_result') }}
{% endif %} {% endif %}
{% endblock js %} {% endblock js %}

View File

@ -74,5 +74,4 @@ module.exports = function(encore, entries)
// Vue entrypoints // Vue entrypoints
encore.addEntry('vue_address', __dirname + '/Resources/public/vuejs/Address/index.js'); encore.addEntry('vue_address', __dirname + '/Resources/public/vuejs/Address/index.js');
encore.addEntry('vue_onthefly', __dirname + '/Resources/public/vuejs/OnTheFly/index.js'); encore.addEntry('vue_onthefly', __dirname + '/Resources/public/vuejs/OnTheFly/index.js');
encore.addEntry('vue_form_action_goal_result', __dirname + '/Resources/public/vuejs/FormActionGoalResult/index.js');
}; };

View File

@ -157,7 +157,7 @@ export default {
this.goals.hiddenField.value = ''; this.goals.hiddenField.value = '';
this.results.hiddenField.value = ''; this.results.hiddenField.value = '';
console.log(this.actions.hiddenField, this.goals.hiddenField, this.results.hiddenField); //console.log(this.actions.hiddenField, this.goals.hiddenField, this.results.hiddenField);
}, },
methods: { methods: {
async getSocialActionsList() { async getSocialActionsList() {
@ -169,7 +169,7 @@ export default {
* @param value * @param value
*/ */
selectAction(value) { selectAction(value) {
console.log('----'); console.log('select action', value.id); //console.log('----'); console.log('select action', value.id);
let children = this.getChildrensFromParent(value); let children = this.getChildrensFromParent(value);
this.addSelectedElement('actions', children); this.addSelectedElement('actions', children);
@ -187,7 +187,7 @@ export default {
}, },
unselectAction(value) { unselectAction(value) {
console.log('----'); console.log('unselect action', value.id); //console.log('----'); console.log('unselect action', value.id);
getGoalByAction(value.id).then(response => new Promise((resolve, reject) => { getGoalByAction(value.id).then(response => new Promise((resolve, reject) => {
[ this.goals.options, this.goals.value ] = this.removeElementInData('goals', response.results); [ this.goals.options, this.goals.value ] = this.removeElementInData('goals', response.results);
resolve(); resolve();
@ -203,7 +203,7 @@ export default {
* @param value * @param value
*/ */
selectGoal(value) { selectGoal(value) {
console.log('----'); console.log('select goal', value.id); //console.log('----'); console.log('select goal', value.id);
getResultByGoal(value.id).then(response => new Promise((resolve, reject) => { getResultByGoal(value.id).then(response => new Promise((resolve, reject) => {
this.addElementInData('results', response.results); this.addElementInData('results', response.results);
resolve(); resolve();
@ -211,7 +211,7 @@ export default {
}, },
unselectGoal(value) { unselectGoal(value) {
console.log('----'); console.log('unselect goal', value.id); //console.log('----'); console.log('unselect goal', value.id);
getResultByGoal(value.id).then(response => new Promise((resolve, reject) => { getResultByGoal(value.id).then(response => new Promise((resolve, reject) => {
[ this.results.options, this.results.value ] = this.removeElementInData('results', response.results); [ this.results.options, this.results.value ] = this.removeElementInData('results', response.results);
resolve(); resolve();
@ -223,11 +223,11 @@ export default {
* @param value * @param value
*/ */
selectResult(value) { selectResult(value) {
console.log('----'); console.log('select result', value.id); //console.log('----'); console.log('select result', value.id);
}, },
unselectResult(value) { unselectResult(value) {
console.log('----'); console.log('unselect result', value.id); //console.log('----'); console.log('unselect result', value.id);
}, },
/** /**
@ -239,7 +239,7 @@ export default {
if (null === value.parent) { if (null === value.parent) {
let excludeParent = this.actions.options.filter(o => o.parent !== null); let excludeParent = this.actions.options.filter(o => o.parent !== null);
let children = excludeParent.filter(o => o.parent.id === value.id); let children = excludeParent.filter(o => o.parent.id === value.id);
console.log("get childrens", children.map(e => e.id)); //console.log("get childrens", children.map(e => e.id));
return children; return children;
} }
return []; return [];
@ -261,7 +261,7 @@ export default {
} }
}) })
if (dump.length > 0) { if (dump.length > 0) {
console.log('push ' + dump.length + ' elems in', target, dump); //console.log('push ' + dump.length + ' elems in', target, dump);
} }
}, },
@ -284,7 +284,7 @@ export default {
} }
}) })
if (dump.length > 0) { if (dump.length > 0) {
console.log('remove ' + dump.length + ' elems from ' + target + ' options', dump); //console.log('remove ' + dump.length + ' elems from ' + target + ' options', dump);
} }
return [ data.options, data.value ]; return [ data.options, data.value ];
}, },
@ -309,7 +309,7 @@ export default {
} }
}); });
if (dump.length > 0) { if (dump.length > 0) {
console.log('add ' + dump.length + ' selected elems in', target, dump); //console.log('add ' + dump.length + ' selected elems in', target, dump);
} }
}, },
@ -325,7 +325,7 @@ export default {
// remove from selected // remove from selected
data.value = data.value.filter(e => e.id !== elem.id); data.value = data.value.filter(e => e.id !== elem.id);
console.log('remove ' + elem.id + ' from selected ' + target); //console.log('remove ' + elem.id + ' from selected ' + target);
// remove from hiddenField // remove from hiddenField
this.rebuildHiddenFieldValues(target); this.rebuildHiddenFieldValues(target);
@ -343,9 +343,9 @@ export default {
*/ */
unselectToNextField(target, elem) { unselectToNextField(target, elem) {
if (target === 'goals') { if (target === 'goals') {
console.log('!!!! target is goal: unselect goal', elem.id); //console.log('!!!! target is goal: unselect goal', elem.id);
this.unselectGoal(elem); this.unselectGoal(elem);
console.log('!!!! done'); //console.log('!!!! done');
} }
}, },
@ -355,12 +355,12 @@ export default {
*/ */
rebuildHiddenFieldValues(target) { rebuildHiddenFieldValues(target) {
let data = this[target]; let data = this[target];
console.log('rebuild hiddenFields ' + target + ' values :'); //console.log('rebuild hiddenFields ' + target + ' values :');
data.hiddenField.value = ''; // reset data.hiddenField.value = ''; // reset
data.value.forEach(elem => { data.value.forEach(elem => {
data.hiddenField.value = this.addIdToValue(data.hiddenField.value, elem.id); data.hiddenField.value = this.addIdToValue(data.hiddenField.value, elem.id);
}) })
console.log(data.hiddenField); //console.log(data.hiddenField);
}, },
addIdToValue(string, id) { addIdToValue(string, id) {

View File

@ -13,6 +13,7 @@ module.exports = function(encore, entries)
encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js'); encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js'); encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
encore.addEntry('vue_visgraph', __dirname + '/Resources/public/vuejs/VisGraph/index.js'); encore.addEntry('vue_visgraph', __dirname + '/Resources/public/vuejs/VisGraph/index.js');
encore.addEntry('vue_export_action_goal_result', __dirname + '/Resources/public/vuejs/ExportFormActionGoalResult/index.js');
encore.addEntry('mod_set_referrer', __dirname + '/Resources/public/mod/AccompanyingPeriod/setReferrer.js'); encore.addEntry('mod_set_referrer', __dirname + '/Resources/public/mod/AccompanyingPeriod/setReferrer.js');