{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/admin/projects/dms/src/dealer_admin/src/views/training/course/index.vue?vue&type=script&lang=js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/views/training/course/index.vue","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport * as API from \"@/api/training_course.js\";\nimport waves from \"@/directive/waves\"; // waves directive\nimport {parseTime} from \"@/utils\";\nimport Form from \"../components/course_form.vue\";\nimport Pagination from \"@/components/Pagination\";\n\nexport default {\n  name: \"TrainingCourse\",\n  components: {Form,Pagination},\n  directives: {waves},\n  data() {\n    return {\n      list: [],\n      total: 0,\n      listLoading: true,\n      listQuery: {\n        page: 1,\n        limit: 10,\n        training_id: '',\n        stage_id: ''\n      },\n      courseTypeList:[],\n      courseTypeMap:{},\n    };\n  },\n  created() {\n    this.$forceUpdate();\n    let query = this.$route.query;\n    this.listQuery.training_id = query.training;\n    this.listQuery.stage_id = query.stage;\n    this.getCourseTypeList();\n    this.getCourseTypeMap();\n    this.getList();\n  },\n  methods: {\n    async getList() {\n      this.listLoading = true;\n      const res = await API.list(this.listQuery);\n      this.total = res.result.total;\n      let list = res.result.list;\n      this.list = [];\n      this.list = list;\n      this.listLoading = false;\n    },\n    async getCourseTypeList() {\n      const res = await API.getCourseTypeList();\n      let {list} = res.result;\n      this.courseTypeList = list;\n    },\n    async getCourseTypeMap(){\n      const res = await API.getCourseTypeMap();\n      let {course_type} = res.result;\n      this.courseTypeMap = course_type;\n    },\n    async delHandle(id) {\n      this.$confirm(\"确认删除???\", \"提示\")\n        .then(async _ => {\n          console.log(\"确认\");\n          const res = await API.del(id);\n          if (res.__error === 0) {\n            this.$message({\n              message: \"成功\",\n              type: \"success\"\n            });\n            this.getList();\n          }\n        })\n        .catch(_ => {\n          console.log(\"取消\");\n        });\n    },\n    fromHandle(id) {\n      this.$nextTick(() => {\n        this.$refs.fromType.init(id,this.listQuery.training_id,this.listQuery.stage_id);\n      });\n    },\n    handleFilter() {\n      this.listQuery.page = 1;\n      this.getList();\n    }\n  }\n};\n",null]}