{"version":3,"sources":["webpack:///./src/views/pages/Examination/ExamBySubject/index.vue?5b0f","webpack:///src/views/pages/Examination/ExamBySubject/index.vue","webpack:///./src/views/pages/Examination/ExamBySubject/index.vue?f441","webpack:///./src/views/pages/Examination/ExamBySubject/index.vue","webpack:///./src/views/pages/Examination/ExamBySubject/data/data-template.js","webpack:///./src/views/pages/Examination/ExamBySubject/actions.js","webpack:///./src/views/pages/Examination/ExamBySubject/data/data-loader.js","webpack:///./src/views/pages/Examination/ExamBySubject/data/index.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","layout","tag","staticRenderFns","props","routerProps","type","Object","default","components","computed","state","success","error","watch","methods","beforeCreate","_name","component","table","header","title","id","list","nameLocal","score","questionTypeCode","unitSeq","form","filter","degreeId","subjectGroupId","subjectId","teacherId","input","examId","subjectCode","teacherCode","selectedSheet","examQuestionScoreBySheet","courseOutlineRegistrationInput","actions","loadData","loaderTimeout","setTimeout","local","loading","status","active","message","i","store","dispatch","examQuestionsFilterInput","result","data","Array","isArray","length","clearTimeout","loadSubjects","payload","selectorOptions","subject","loadTeacherList","_store","Vue","observable","editor","template","filterSelection","academicPeriod","degree","subjectGroup","teacher","courseOutline"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,MAAM,CAAC,GAAK,gCAAgC,CAACF,EAAGJ,EAAIO,OAAO,CAACC,IAAI,eAAe,IACrLC,EAAkB,G,8ECetB,G,UAAA,CACEC,MAAO,CACLC,YAAa,CACXC,KAAMC,OACNC,QAAS,WAAf,YAGEC,WAAY,CACV,iBAAkB,WAAtB,yDAEEC,SAAU,CACRT,OADJ,WAEM,MAAO,kBAETU,MAJJ,WAKM,OAAO,EAAb,MAEIC,QAPJ,WAQM,OAAO,EAAb,gCAEIC,MAVJ,WAWM,OAAO,EAAb,+BAGEC,MAAO,CACLF,QA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B,EAhBc,OAoBZP,EAAiBO,EAAjBP,OAAQQ,EAASD,EAATC,KAGZR,EAAOnC,SAAW4C,MAAMC,QAAQF,KAClC5C,OAAMkC,MAAMtB,KAAOgC,EAEfA,EAAKG,OAAS,IAChB/C,OAAMkC,MAAME,OAAOxB,KAAO,CAACyB,QAAQ,EAAMC,QAAS,YAEpDU,aAAahB,GACbhC,OAAMkC,MAAMC,QAAQvB,MAAO,GA9BT,8IAAH,sDAkGRqC,EAAY,yDAAG,WAAO7B,GAAP,8FAEpB8B,EAAU,CAAE9B,kBAFQ,SAGkBoB,OAAMC,SAAS,gDAAiDS,GAHlF,OAG1BlD,OAAMkC,MAAMiB,gBAAgBC,QAHF,kDAAH,sDAaZC,EAAe,yDAAG,8GACvBb,OAAMC,SAAS,uBADQ,2CAAH,sD,wHCpHfzC,EAAQ,CAGnBwC,MAAOc,OAAOtD,MAGdkC,MAAOqB,aAAIC,WAAW,CAEpB5C,KAAM,GAGN6C,OAAQ,CAAEpB,QAAQ,GAGlBpB,KAAM,kBAAKyC,OAASzC,MAGpB0C,gBAAiB,CACfC,eAAgB,KAChBC,OAAQ,KACRC,aAAc,KACdV,QAAS,KACTW,QAAS,MAIXvD,MAAO,CACLoC,KAAM,IAIRT,QAAS,CACPvB,MAAM,GAIRwB,OAAQ,CACNxB,KAAM,CACJyB,QAAQ,EACRC,QAAS,KAKba,gBAAiB,CACfC,QAAS,GACTY,cAAe","file":"js/chunk-b8eeaaf8.046b7603.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"course-outline-registration\"}},[_c(_vm.layout,{tag:\"component\"})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n","import mod from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=57823b0f&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export default {\n table: {\n header: [\n { title: \"#\", id: \"order\" },\n { title: \"คำถาม\", id: \"nameLocal\" },\n { title: \"คะแนน\", id: \"score\" },\n { title: \"ประเภท\", id: \"questionTypeCode\" },\n { title: \"UnitID\", id: \"unitSeq\" },\n { title: \" \", id: \"actions\" }\n ]\n },\n list: [\n {\n nameLocal: \"QUESTION\",\n score: \"SCORE\",\n questionTypeCode: \"TYPE\",\n unitSeq: \"UNIT ID\"\n }\n ],\n form: {\n filter: {\n // academicPeriodId: \"\",\n // periodCode: \"\",\n degreeId: \"\",\n subjectGroupId: \"\",\n subjectId: \"\",\n // subjectCode: \"\",\n // subjectName: \"\",\n // courseOutlineId: \"\",\n teacherId: \"\",\n // teacherCode: \"\",\n },\n input: {\n examId: null,\n subjectId: null,\n teacherId: null,\n subjectCode: null,\n teacherCode: null,\n score: 1\n },\n selectedSheet: [],\n examQuestionScoreBySheet: [],\n courseOutlineRegistrationInput: []\n }\n};\n","import { state } from \"./data\";\n\nlet actions = null;\n\nexport { actions as default };\n\n/**\n * Init Actions: (Mutate actions variable and export it);\n * initialization is needed for inject Vue component instance.\n * usually init it in root component created hook.\n * @param {VueComponent} root The instance of root component;\n */\n\n export const initActions = (root) => {\n if (root) {\n if (root._isVue) {\n actions = {\n isValid: true,\n add: add(root),\n refresh: refresh(root),\n bulkImport: bulkImport(root)\n }\n }\n }\n}\n\n\n/**\n * Refresh: Click this and data of the page will be refreshed.\n * @param {VueInstance} root The Vue instance of this page 's root component. \n * @return {Object} The object contain a page action.\n */\n\nfunction refresh (root) {\n return {\n name: \"refresh\",\n title: \"Refresh\",\n classes: ['button-green'],\n handlers: {\n click() {\n // Load data from root component and leverage the use its lifecycle mechanism.\n root.loadData();\n }\n }\n }\n}\n\n\n/**\n * Add: add a new data set according to the page, data usually a list shows in list table.\n * @param {VueInstance} root The Vue instance of this page 's root component. \n * @return {Object} The object contain a page action.\n */\n\nfunction add (/* root */) {\n return {\n name: \"add\",\n title: \"Add\",\n classes: ['button-red'],\n handlers: {\n click: () => {\n // Mutate state for activate local editor.\n state.local.editor = { name: \"EditExam\", mode: \"add\", active: true };\n }\n }\n }\n}\n\n\n/**\n * bulkImport: import a new data set according to the page, data usually a list shows in list table.\n * @param {VueInstance} root The Vue instance of this page 's root component. \n * @return {Object} The object contain a page action.\n */\n\nfunction bulkImport (root) {\n return {\n name: \"import\",\n title: \"Import\",\n classes: ['button-red'],\n handlers: {\n click: () => {\n root.upload();\n }\n }\n }\n}\n","/* ********************************\n * Data Loaders\n * ********************************\n */\n\n/* eslint-disable no-unused-vars */\nimport {state} from \"./index\";\nimport store from \"@/store\";\n// // import { getSubjectsBySubjectGroup } from \"@/services/api/common-data\";\n// // import { getCourseOutlines } from \"@/services/api/course-outline\";\n\n/**\n * Load Data\n *\n * @return No return.\n *\n */\n\nexport const loadData = async (filter) => {\n\n const loaderTimeout = setTimeout(() => {\n state.local.loading.list = false;\n state.local.status.list = { active: true, message: \"Time out\" }\n }, 10000);\n\n try {\n // Set loading state\n state.local.loading.list = true;\n\n // Purge previous list items.\n // Do not use = [] cause it will break observable and reactivity.\n state.local.list = state.local.list.filter(i => !i);\n\n //\n const result =\n await store.dispatch(\"Examination/getExamQuestionListByFilter\", { examQuestionsFilterInput: filter });\n\n //\n const { status, data } = result;\n\n // Set new data to the list.\n if (status.success && Array.isArray(data)) {\n state.local.list = data;\n\n if (data.length < 1) {\n state.local.status.list = {active: true, message: \"No Data\"};\n }\n clearTimeout(loaderTimeout);\n state.local.loading.list = false;\n }\n\n // Set new options to selectors.\n\n } catch (e) {\n return e;\n // TODO: Handle Error\n // console.log(e);\n }\n};\n\n\n/**\n * Load Selector Options\n *\n * @return No return.\n *\n */\n\nexport const loadSelectors = async () => {\n\n};\n\n\n/**\n * Load Academic Periods Options\n *\n * @return No return.\n *\n */\n\nexport const loadAcademicPeriods = async () => {\n store.dispatch(\"CommonData/AcademicPeriod/getAcademicPeriods\");\n};\n\n\n/**\n * Load Degree Options\n *\n * @return No return.\n *\n */\n\nexport const loadDegrees = async () => {\n store.dispatch(\"CommonData/Degree/getDegrees\");\n};\n\n\n/**\n * Load Subject Group Options\n *\n * @return No return.\n *\n */\n\nexport const loadSubjectGroups = async () => {\n store.dispatch(\"CommonData/SubjectGroup/getSubjectGroups\");\n};\n\n\n/**\n * Load Subject Options by Subject Group Id\n *\n * @return No return.\n *\n */\n\nexport const loadSubjects = async (subjectGroupId) => {\n // console.log(\"Use subject group id\", subjectGroupId);\n const payload = { subjectGroupId };\n state.local.selectorOptions.subject = await store.dispatch(\"CommonData/Subject/getSubjectBySubjectGroupID\", payload);\n};\n\n/**\n * Load Teacher Options\n *\n * @return No return.\n *\n */\n\nexport const loadTeacherList = async () => {\n await store.dispatch(\"Profile/getTeachers\");\n};\n\nexport const loadCourseOutlineByFilter = async (subjectGroupId) => {\n const payload = { courseOutlineFilterInput: { subjectGroupId } };\n const result = await store.dispatch(\"Courses/CourseOutline/getCourseOutlineByFilter\", payload);\n\n const { status, data } = result;\n if (status.success) {\n state.local.selectorOptions.courseOutline = data;\n }\n};\n","/* ********************************\n * Data States & Templates\n * ********************************\n */\n\n /* eslint-disable no-unused-vars */\nimport Vue from 'vue';\nimport _store from \"@/store\";\n\nimport template from \"./data-template\";\n\nexport { _store as store };\n\nexport const state = {\n\n // States from Vuex store (Read only, don't mutate directly)\n store: _store.state,\n \n // Setup local state here (States which don't shared or long-term keeping);\n local: Vue.observable({\n // Contain list of Course Outline Registration.\n list: [],\n \n // Contain configs of internal editor.\n editor: { active: false },\n\n // Form: Contain form input.\n form: { ...template.form },\n \n // Filter Selection: Contain filter selection states (flatted);\n filterSelection: {\n academicPeriod: null,\n degree: null,\n subjectGroup: null,\n subject: null,\n teacher: null\n },\n\n //\n table: {\n data: []\n },\n \n // Loading: Contain loading state for each subcomponent.\n loading: {\n list: true\n },\n\n // Status for each subcomponent\n status: {\n list: {\n active: false,\n message: \"\"\n }\n },\n\n // Options for specific selector. \n selectorOptions: {\n subject: [],\n courseOutline: []\n }\n })\n};\n"],"sourceRoot":""}