moodle_local_treestudyplan/amd/build/page-result-overview.min.js.map

1 line
6.0 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"page-result-overview.min.js","sources":["../src/page-result-overview.js"],"sourcesContent":["/*eslint no-var: \"error\" */\n/*eslint no-unused-vars: \"off\" */\n/*eslint linebreak-style: \"off\" */\n/*eslint no-trailing-spaces: \"off\" */\n/*eslint-env es6*/\n\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\n\nimport Vue from './vue/vue';\n\nimport Debugger from './util/debugger';\nimport {load_strings} from './util/string-helper';\n\nimport SRComponents from './studyplan-report-components';\nVue.use(SRComponents);\nimport RVComponents from './report-viewer-components';\nVue.use(RVComponents);\n\nimport ModalComponents from './modedit-modal';\nVue.use(ModalComponents);\n\nimport PortalVue from './portal-vue/portal-vue.esm';\nVue.use(PortalVue);\nimport BootstrapVue from './bootstrap-vue/bootstrap-vue';\nVue.use(BootstrapVue);\n\n\nlet debug = new Debugger(\"treestudyplanviewer\");\n\nlet strings = load_strings({\n studyplan_report: {\n studyplan_select_placeholder: 'studyplan_select_placeholder',\n studyplan: 'studyplan',\n page: 'studyplanpage',\n periods: 'periods',\n period: 'period',\n loading: 'loading@core',\n all: 'all@core',\n from: 'from@core',\n to: 'to@core',\n },\n});\n\n/**\n * Initialize the Page\n * @param {Number} studyplanid The id of the studyplan we need to view \n * @param {Number} pageid The id of the studyplan page we need to view \n * @param {Number} firstperiod The number of the first period to view\n * @param {Number} lastperiod The number of the last period to view \n */\nexport function init(studyplanid, pageid, firstperiod, lastperiod) {\n if (undefined === pageid || !Number.isInteger(Number(pageid)) ||\n undefined === studyplanid || !Number.isInteger(Number(studyplanid))) {\n debug.error(\"Error: studyplan id and page id not provided as integer numbers to script.\",\n studyplanid, pageid, firstperiod, lastperiod);\n return; // Do not continue if plan and page are not proper integers\n }\n // Ensure a numeric value instead of string.\n studyplanid = Number(studyplanid);\n pageid = Number(pageid);\n\n // Startup app.\n const app = new Vue({\n el: '#root',\n data: {\n structure: null,\n studyplan: null,\n page: null,\n text: strings.studyplan_report,\n },\n async mounted() {\n \n }, \n created() {\n // On creation, load the page as specified\n this.loadStructure(pageid,firstperiod,lastperiod);\n },\n computed: {\n \n },\n methods: {\n loadStructure(pageid,firstperiod,lastperiod) {\n const self = this;\n this.structure = null; // Starts loading icon. Hides old data.\n call([{\n methodname: 'local_treestudyplan_get_report_structure',\n args: { pageid: pageid,\n firstperiod: firstperiod,\n lastperiod: lastperiod\n }\n }])[0].then(function(response){\n self.structure = response;\n self.studyplan = response.studyplan;\n self.page = response.page;\n }).catch(notification.exception);\n },\n selectedPage(e) {\n debug.info(\"SelectedPage\",e);\n const pageid = e.target.value;\n this.loadStructure(pageid);\n },\n selectedFirstPeriod(e) {\n debug.info(\"selectedFirstPeriod\",e);\n let f = e.target.value;\n let l = this.structure.lastperiod;\n if ( l < f) {\n l = f;\n }\n this.loadStructure(this.page.id,f,l);\n },\n selectedLastPeriod(e) {\n debug.info(\"selectedLastPeriod\",e);\n let f = this.