1 line
No EOL
6.2 KiB
Text
1 line
No EOL
6.2 KiB
Text
{"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 {loadStrings} 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\nlet debug = new Debugger(\"treestudyplanviewer\");\n\nlet strings = loadStrings({\n studyplanReport: {\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 {string} contextname The name of the current context\n * @param {string} studyplanname The name of the current studyplan\n * @param {string} pagename The name of the current page\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, contextname, studyplanname, \n pagename, 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.studyplanReport,\n contextname: contextname,\n studyplanname: studyplanname,\n pagename: pagename,\n },\n created() {\n // On creation, load the page as specified\n this.loadStructure(pageid, firstperiod, lastperiod);\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((response) => {\n self.structure = response;\n self.studyplan = response.studyplan;\n self.page = response.page;\n return;\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.structure.firstperiod;\n let l = e.target.value;\n if (l < f) {\n l = f;\n }\n this.loadStructure(this.page.id, f, l);\n\n },\n },\n });\n}\n"],"names":["studyplanid","pageid","contextname","studyplanname","pagename","firstperiod","lastperiod","undefined","Number","isInteger","debug","error","Vue","el","data","structure","studyplan","page","text","strings","studyplanReport","created","loadStructure","methods","self","this","methodname","args","then","response","catch","notification","exception","selectedPage","e","info","target","value","selectedFirstPeriod","f","l","id","selectedLastPeriod","use","SRComponents","RVComponents","ModalComponents","PortalVue","BootstrapVue","Debugger","periods","period","loading","all","from","to"],"mappings":"gmBAoDqBA,YAAaC,OAAQC,YAAaC,cAClCC,SAAUC,YAAaC,oBACpCC,IAAcN,SAAWO,OAAOC,UAAUD,OAAOP,eACjDM,IAAcP,cAAgBQ,OAAOC,UAAUD,OAAOR,0BACtDU,MAAMC,MAAM,6EACRX,YAAaC,OAAQI,YAAaC,YAI1CN,YAAc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