{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\views\\mainDataMenu\\components\\subMenuDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\views\\mainDataMenu\\components\\subMenuDialog.vue","mtime":1686814052230},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\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//\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//\n//\n//\nimport equSysMenu from '@/api/examination/equSysMenu.js';\nimport userTypeMenu from '@/api/examination/userTypeMenu.js';\nimport subMenu from '@/api/examination/subMenu.js';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport jobsDialog from \"./jobsDialog.vue\";\nimport professionalDialog from \"./professionalDialog.vue\";\nexport default {\n  components: {\n    jobsDialog: jobsDialog,\n    professionalDialog: professionalDialog\n  },\n  name: 'subMenuDialog',\n  data: function data() {\n    return {\n      rules: {\n        // code: [{\n        // \trequired: true,\n        // \tmessage: '请输入课目编码',\n        // \ttrigger: 'blur',\n        // }, ],\n        name: [{\n          required: true,\n          message: '请输入课目名称',\n          trigger: 'blur'\n        }],\n        trainType: [{\n          required: true,\n          message: '请选择训练类别',\n          trigger: 'blur'\n        }],\n        TrainLevel: [{\n          required: true,\n          message: '请选择训练级别',\n          trigger: 'blur'\n        }] // userTypeId: [{\n        // \trequired: true,\n        // \tmessage: '请选择人员类别',\n        // \ttrigger: 'blur',\n        // }, ],\n\n      },\n      visible: false,\n      parameter: {\n        // typeId: '',\n        // code: \"\",\n        // majorId: \"\",\n        memo: \"\",\n        name: \"\",\n        positonVos: [],\n        // positionId: \"\",\n        trainLevel: \"\",\n        trainType: \"\"\n      },\n      equList: [],\n      TrainTypeList: [],\n      TrainLevelList: [],\n      positionList: [],\n      jobPageList: [],\n      //专业装备\n      professionals: [],\n      professionalsList: [],\n      //所属岗位\n      positonVos: [],\n      positonVosList: [],\n      title: '',\n      treeData: []\n    };\n  },\n  created: function created() {\n    this.TrainTypeList = dictUtils.getDictItemsFromCache('xllb');\n    this.TrainLevelList = dictUtils.getDictItemsFromCache('xljb');\n  },\n  mounted: function mounted() {},\n  methods: {\n    // 获取装备系统\n    getTreen: function getTreen() {\n      var _this = this;\n\n      equSysMenu.geteqTree({\n        id: '0'\n      }, function (res) {\n        _this.equList = res.value;\n      });\n    },\n    getCode: function getCode() {\n      var _this2 = this;\n\n      userTypeMenu.getPinyin(this.parameter.name, function (res) {\n        if (res.state) {\n          _this2.parameter.code = res.value;\n        }\n      });\n    },\n    // 获取岗位信息\n    getPostion: function getPostion() {\n      var _this3 = this;\n\n      var obj = {\n        pageBean: {\n          page: 1,\n          pageSize: -1\n        }\n      };\n      subMenu.getPosition(obj, function (res) {\n        _this3.positionList = res.rows;\n      });\n    },\n    handleChange: function handleChange(val) {\n      var ArrIds = [];\n      ArrIds = val;\n\n      if (ArrIds.length == 0) {\n        this.parameter.majorId = ArrIds[0];\n      } else {\n        this.parameter.majorId = ArrIds[val.length - 1];\n      }\n\n      console.log(this.parameter);\n    },\n    add: function add(orgId, majorId, positionId) {\n      console.log(orgId, majorId, positionId);\n      this.parameter.positonVos = [{\n        orgId: orgId,\n        majorId: majorId,\n        positionId: positionId\n      }]; // this.parameter.orgId=orgId\n      // this.parameter.majorId=majorId\n      // this.parameter.positionId=positionId\n\n      this.title = '新增';\n      this.visible = true; // this.professionalsList = []\n      // this.professionals = []\n\n      this.positonVosList = []; // this.positonVos = []\n      // this.getTreen()\n      // this.getPostion()\n      // this.getJobPage()\n    },\n    edit: function edit(val, orgId, majorId, positionId) {\n      var _this4 = this;\n\n      console.log(val, orgId, majorId, positionId); // this.getTreen()\n      // this.getPostion()\n      // this.getJobPage()\n\n      this.title = '修改';\n      this.visible = true;\n      this.getEqu();\n      subMenu.findById(val.id, function (res) {\n        _this4.parameter = res;\n        _this4.parameter.positonVos = [{\n          orgId: orgId,\n          majorId: majorId,\n          positionId: positionId\n        }]; // \tthis.parameter.positonVos.forEach(e => {\n        // \t\tif (e.positionId && e.positionName && e.positionCode) {\n        // \t\t\tthis.positonVosList.push({\n        // \t\t\t\tpositionId: e.positionId,\n        // \t\t\t\tpositionName: e.positionName,\n        // \t\t\t\tpositionCode: e.positionCode\n        // \t\t\t})\n        // \t\t\tthis.positonVos.push(e.positionId)\n        // \t\t}\n        // \t})\n        // \tthis.parameter.sysList.forEach(s => {\n        // \t\tthis.professionalsList.push({\n        // \t\t\tmajorId: s.id,\n        // \t\t\tmajorName: s.name\n        // \t\t})\n        // \t\tthis.professionals.push(s.id)\n        // \t})\n        // \tdelete this.parameter.sysList\n      });\n    },\n    getEqu: function getEqu() {\n      var _this5 = this;\n\n      equSysMenu.geteqTree({\n        pageBean: {\n          pageSize: -1,\n          page: -1\n        }\n      }, function (res) {\n        _this5.treeData = res.value;\n      });\n    },\n    // 关闭\n    handleClose: function handleClose() {\n      this.visible = false;\n      this.title = '新增';\n      this.parameter = {\n        // typeId: '',\n        // code: \"\",\n        // majorId: \"\",\n        memo: \"\",\n        name: \"\",\n        positonVos: [],\n        // positionId: \"\",\n        trainLevel: \"\",\n        trainType: \"\"\n      }; // this.professionals = []\n      // this.professionalsList = []\n      // this.positonVos = []\n      // this.positonVosList = []\n    },\n    // 保存\n    handleSave: function handleSave() {\n      var _this6 = this;\n\n      console.log(this.parameter); // this.parameter.positonVos = this.professionalsList.concat(this.positonVosList)\n      // let arr =this.professionalsList.length>this.positonVosList.length?this.professionalsList:this.positonVosList\n      // let aArr\n      // let bArr\n      // if (this.professionalsList.length > this.positonVosList.length) {\n      // \taArr = this.professionalsList\n      // \tbArr = this.positonVosList\n      // } else {\n      // \taArr = this.positonVosList\n      // \tbArr = this.professionalsList\n      // }\n      // this.parameter.positonVos = aArr.map((item, index) => {\n      // \treturn {\n      // \t\t...bArr[index],\n      // \t\t...item\n      // \t};\n      // });\n\n      this.$refs.formInfo.validate(function (valid) {\n        if (valid) {\n          var method;\n\n          if (_this6.title === '新增') {\n            method = subMenu.addsubject;\n          }\n\n          if (_this6.title === '修改') {\n            method = subMenu.editSubject;\n          }\n\n          method(_this6.parameter, function (response) {\n            if (response.state) {\n              _this6.$notify({\n                type: 'success',\n                message: _this6.title + '成功',\n                duration: 2000\n              });\n\n              _this6.handleClose();\n\n              _this6.$emit('reload');\n            } else {\n              _this6.$message.warning(response.message);\n            }\n          });\n        }\n      });\n    },\n    //打开专业装备\n    professionalDUsers: function professionalDUsers() {\n      this.$refs.professional.add(this.parameter.userTypeId, this.professionalsList);\n    },\n    //打开所属岗位\n    selectUsers: function selectUsers() {\n      this.$refs.jobsDialog.add(this.professionals, this.positonVosList);\n    },\n    //子调用父\n    professionalgetUser: function professionalgetUser(val) {\n      var _this7 = this;\n\n      this.professionals = [];\n      this.professionalsList = val;\n      this.professionalsList.forEach(function (p) {\n        _this7.professionals.push(p.majorId);\n      });\n    },\n    getUser: function getUser(val) {\n      var _this8 = this;\n\n      this.positonVos = [];\n      this.positonVosList = val;\n      this.positonVosList.forEach(function (p) {\n        _this8.positonVos.push(p.positionId);\n      });\n      console.log(this.positonVosList);\n    },\n    //获取人员类别\n    getJobPage: function getJobPage() {\n      var _this9 = this;\n\n      subMenu.getJobPage(this.queryParam, function (res) {\n        if (res.rows) {\n          _this9.jobPageList = res.rows;\n        }\n      });\n    },\n    //删除专业装备\n    selectProfessionals: function selectProfessionals(val) {\n      var _this10 = this;\n\n      var arr = JSON.parse(JSON.stringify(this.professionalsList));\n      this.professionalsList = [];\n      arr.forEach(function (p, pi) {\n        val.forEach(function (v) {\n          if (p.majorId == v) {\n            _this10.professionalsList.push(p);\n          }\n        });\n      });\n      console.log(this.professionalsList);\n    },\n    //删除关联岗位\n    selectPositonVos: function selectPositonVos(val) {\n      var _this11 = this;\n\n      var arr = JSON.parse(JSON.stringify(this.positonVosList));\n      this.positonVosList = [];\n      arr.forEach(function (p, pi) {\n        val.forEach(function (v) {\n          if (p.positionId == v) {\n            _this11.positonVosList.push(p);\n          }\n        });\n      });\n      console.log(this.positonVosList);\n    }\n  }\n};",null]}