mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
Add CalculatedVars "Studiengang of user"
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import FormInput from '../../../../../../Form/Input.js';
|
||||
|
||||
export default {
|
||||
name: "WidgetsGenteratorReportVarsVarCalcRight",
|
||||
components: {
|
||||
FormInput,
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
"update:modelValue",
|
||||
],
|
||||
computed: {
|
||||
modelValueCmp: {
|
||||
get() {
|
||||
return this.modelValue;
|
||||
},
|
||||
set(v) {
|
||||
this.$emit('update:modelValue', v);
|
||||
},
|
||||
},
|
||||
},
|
||||
// TODO(chris): phrases: placeholder
|
||||
template: /*html*/ `
|
||||
<form-input
|
||||
v-model="modelValueCmp"
|
||||
class="widgets-report-config-vars-var-calc-right"
|
||||
type="text"
|
||||
input-group
|
||||
placeholder="Access Right (comma separated)"
|
||||
>
|
||||
</form-input>
|
||||
`,
|
||||
};
|
||||
@@ -17,11 +17,13 @@
|
||||
|
||||
import CurrentStudienjahr from './CalculatedVars/CurrentStudienjahr.js';
|
||||
import CalcDate from './CalculatedVars/CalcDate.js';
|
||||
import UserStgs from './CalculatedVars/UserStgs.js';
|
||||
|
||||
export function useCalculatedVars() {
|
||||
let calculations = {
|
||||
CurrentStudienjahr,
|
||||
CalcDate,
|
||||
UserStgs,
|
||||
};
|
||||
|
||||
const components = Vue.ref({});
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import CalcRight from '../../../../components/Dashboard/WidgetAdmin/Edit/Report/Vars/Calc/Right.js';
|
||||
|
||||
import ApiStudiengang from '../../../../api/factory/studiengang.js';
|
||||
|
||||
export default {
|
||||
label: 'UserStgs',
|
||||
component: CalcRight,
|
||||
async calculate(instructions) {
|
||||
try {
|
||||
const result = await this.$api.call(ApiStudiengang.getAllowed(instructions[2]));
|
||||
return result.data;
|
||||
} catch(error) {
|
||||
this.$fhcAlert.handleSystemError(error);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user