{"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\\zlMenu\\components\\zlxxMenuDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\views\\zlMenu\\components\\zlxxMenuDialog.vue","mtime":1705466684692},{"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\";\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 dictUtils from '@/components/dict/DictSelectUtils.js';\nimport zlxxMenu from '@/api/examination/zlxxMenu.js';\nimport SelectOrganize from \"./SelectOrganize.vue\";\nimport SelectUser from \"./SelectUser.vue\";\nimport { fail } from 'assert';\nimport { mapState } from 'vuex';\nexport default {\n  name: 'zlxxMenuDialog',\n  components: {\n    SelectOrganize: SelectOrganize,\n    SelectUser: SelectUser\n  },\n  data: function data() {\n    return {\n      // 附件上传\n      fileList: [],\n      uploadUrl: window.context.portal + '/file/v1/fileUpload',\n      // 服务器上传地址\n      accept: '.bmp,.jpg,.png,.tif,.gif,.pcx,.tga,.exif,.fpx,.svg,.psd,.cdr,.pcd,.dxf,.ufo,.eps,.ai,.raw,.WMF,.webp,.avif,.apng,.xls,.docx,.docm,.doc,.dotx,.pptx,.pptm,.ppt,.pdf,.xps,.potx,.txt,.xls,.xlsx,.xps,.zip,.rar,.7z',\n      previewUrl: window.context.portal + '/file/v1/downloadFile?fileId=',\n      // \n      title: '新增',\n      visible: false,\n      parameter: {\n        examFiles: [],\n        examMaterialVo: {\n          accessControlList: [],\n          accessControlType: \"\",\n          authType: \"\",\n          typeId: \"\"\n        },\n        keyword: \"\",\n        memo: \"\",\n        title: \"\",\n        typeId: \"\"\n      },\n      MaterialDataType: [],\n      rules: {\n        title: [{\n          required: true,\n          message: '请输入资料名称',\n          trigger: 'blur'\n        }],\n        typeId: [{\n          required: true,\n          message: '请选择资料分类',\n          trigger: 'blur'\n        }],\n        keyword: [{\n          required: true,\n          message: '请输入关键词',\n          trigger: 'blur'\n        }]\n      },\n      materialTypeList: [],\n      accessControlTypeList: [],\n      // 组织列表\n      OrgsLists: [],\n      OrgsListIds: [],\n      // 用户列表\n      UsersListIds: [],\n      UsersList: []\n    };\n  },\n  created: function created() {\n    this.accessControlTypeList = dictUtils.getDictItemsFromCache('qxsklx');\n  },\n  mounted: function mounted() {\n    // ref绑定自定义事件\n    this.$refs.OrgsModal.$on('getOrgs', this.getOrg);\n    this.$refs.UsersModal.$on('getUser', this.getUser);\n  },\n  computed: mapState({\n    header: function header(state) {\n      return {\n        Authorization: \"Bearer \".concat(state.login.currentUser.token)\n      };\n    }\n  }),\n  methods: {\n    // 附件上传\n    uploadSuccess: function uploadSuccess(res) {\n      if (res) {\n        // this.parameter.examFiles = []\n        this.parameter.examFiles.push({\n          fileName: res.fileName,\n          id: res.fileId,\n          fileUrl: this.previewUrl + res.fileId,\n          fileSizes: res.size\n        });\n      } else {\n        // 提示信息，需引入Message\n        this.$message.error('上传失败！');\n      }\n    },\n    beforeUpload: function beforeUpload(file) {\n      return true;\n    },\n    // 文件移除\n    beforeRemove: function beforeRemove(file, fileList) {\n      var _this = this;\n\n      zlxxMenu.removeFile(file.id, function (res) {\n        if (res.state) {\n          _this.parameter.examFiles.forEach(function (item, index, arr) {\n            if (file.id == item.id) {\n              arr.splice(index, 1);\n            }\n          });\n\n          _this.$notify({\n            type: 'success',\n            message: '删除成功',\n            duration: 2000\n          });\n        }\n      });\n    },\n    clearData: function clearData() {\n      if (this.parameter.examMaterialVo.accessControlType == \"1\") {\n        this.UsersList = [];\n        this.UsersListIds = [];\n        this.OrgsLists = [];\n        this.OrgsListIds = [];\n      }\n\n      if (this.parameter.examMaterialVo.accessControlType == \"2\") {\n        this.UsersList = [];\n        this.UsersListIds = [];\n      }\n\n      if (this.parameter.examMaterialVo.accessControlType == \"3\") {\n        this.OrgsLists = [];\n        this.OrgsListIds = [];\n      }\n    },\n    selectOne: function selectOne(val) {\n      var _this2 = this;\n\n      var arr = JSON.parse(JSON.stringify(this.OrgsLists));\n      this.OrgsLists = [];\n      arr.forEach(function (p, pi) {\n        val.forEach(function (v) {\n          if (p.accessControlId == v) {\n            _this2.OrgsLists.push(p);\n          }\n        });\n      });\n    },\n    selectTwo: function selectTwo(val) {\n      var _this3 = this;\n\n      var arr = JSON.parse(JSON.stringify(this.UsersList));\n      this.UsersList = [];\n      arr.forEach(function (p, pi) {\n        val.forEach(function (v) {\n          if (p.accessControlId == v) {\n            _this3.UsersList.push(p);\n          }\n        });\n      });\n    },\n    clear: function clear() {\n      this.OrgsListIds = [];\n      this.OrgsLists = [];\n      this.UsersListIds = [];\n      this.UsersList = [];\n    },\n    selectOrgs: function selectOrgs() {\n      this.$refs.OrgsModal.handleShow(this.OrgsLists);\n    },\n    selectUsers: function selectUsers() {\n      this.$refs.UsersModal.handleShow(this.UsersList);\n    },\n    getOrg: function getOrg(item) {\n      var _this4 = this;\n\n      console.log(item);\n      this.OrgsListIds = [];\n      this.OrgsLists = item;\n      this.OrgsLists.forEach(function (item) {\n        _this4.OrgsListIds.push(item.accessControlId);\n      });\n    },\n    getUser: function getUser(item) {\n      var _this5 = this;\n\n      this.UsersListIds = [];\n      this.UsersList = item;\n      this.UsersList.forEach(function (item) {\n        _this5.UsersListIds.push(item.accessControlId);\n      });\n    },\n    // 获取树\n    getTreen: function getTreen() {\n      var _this6 = this;\n\n      zlxxMenu.getMaterTree({\n        id: '0'\n      }, function (res) {\n        _this6.MaterialDataType = res.value;\n\n        _this6.$set(_this6.MaterialDataType);\n      });\n    },\n    // id查询详情\n    getdetail: function getdetail(id) {\n      var _this7 = this;\n\n      this.UsersList = [];\n      this.UsersListIds = [];\n      this.OrgsLists = [];\n      this.OrgsListIds = [];\n      zlxxMenu.detailId(id, function (res) {\n        _this7.parameter = res;\n\n        if (_this7.parameter.examMaterialVo.accessControlType == 2) {\n          _this7.OrgsLists = _this7.parameter.examMaterialVo.accessControlList;\n\n          _this7.OrgsLists.forEach(function (s) {\n            _this7.OrgsListIds.push(s.accessControlId);\n          });\n        } else if (_this7.parameter.examMaterialVo.accessControlType == 3) {\n          _this7.UsersList = _this7.parameter.examMaterialVo.accessControlList;\n\n          _this7.UsersList.forEach(function (s) {\n            _this7.UsersListIds.push(s.accessControlId);\n          });\n        }\n\n        _this7.parameter.examFiles.forEach(function (item) {\n          _this7.fileList.push({\n            name: item.fileName,\n            url: item.fileUrl // id: item.id\n\n          });\n        });\n      });\n    },\n    handleChange: function handleChange(val) {\n      var ArrIds = [];\n      ArrIds = val;\n\n      if (ArrIds.length == 0) {\n        this.parameter.typeId = ArrIds[0];\n      } else {\n        this.parameter.typeId = ArrIds[val.length - 1];\n      }\n    },\n    add: function add(val) {\n      this.title = '新增';\n      this.visible = true;\n      this.getTreen();\n    },\n    edit: function edit(val) {\n      this.title = '修改';\n      this.visible = true;\n      this.getTreen();\n      this.getdetail(val.id);\n    },\n    // 关闭新增人员窗口\n    handleClose: function handleClose() {\n      this.visible = false;\n      this.title = '新增';\n      this.parameter = {\n        examFiles: [],\n        examMaterialVo: {\n          accessControlList: [],\n          accessControlType: \"\",\n          authType: \"\",\n          typeId: \"\"\n        },\n        keyword: \"\",\n        memo: \"\",\n        title: \"\",\n        typeId: \"\"\n      };\n      this.fileList = [];\n    },\n    // 保存产品类型\n    handleSave: function handleSave() {\n      var _this8 = this;\n\n      this.parameter.examMaterialVo.accessControlList = [];\n\n      if (this.parameter.examFiles.length > 0) {\n        this.parameter.examFiles.forEach(function (e) {\n          delete e.createTime;\n          delete e.fileExt;\n          delete e.fileType;\n          delete e.isDele;\n          delete e.materialId;\n          delete e.pkVal;\n          delete e.id;\n        });\n      }\n\n      if (this.OrgsLists.length != 0) {\n        // this.OrgsLists.forEach(item => {\n        // \tlet obj = {}\n        // \tobj[\"accessControlId\"] = item.id\n        // \tobj[\"accessControlName\"] = item.name\n        // \tthis.parameter.examMaterialVo.accessControlList.push(obj)\n        // })\n        this.parameter.examMaterialVo.accessControlList = this.OrgsLists;\n      }\n\n      if (this.UsersList.length != 0) {\n        // this.UsersList.forEach(item => {\n        // \tlet obj = {}\n        // \tobj[\"accessControlId\"] = item.id\n        // \tobj[\"accessControlName\"] = item.fullname\n        // \tthis.parameter.examMaterialVo.accessControlList.push(obj)\n        // })\n        this.parameter.examMaterialVo.accessControlList = this.UsersList;\n      }\n\n      this.$refs.formInfo.validate(function (valid) {\n        if (valid) {\n          var method;\n\n          if (_this8.title === '新增') {\n            method = zlxxMenu.addMaterial;\n          }\n\n          if (_this8.title === '修改') {\n            method = zlxxMenu.editMaterial;\n          }\n\n          method(_this8.parameter, function (response) {\n            if (response.state) {\n              _this8.$notify({\n                type: 'success',\n                message: _this8.title + '成功',\n                duration: 2000\n              });\n\n              _this8.handleClose();\n\n              _this8.$emit('loadData');\n            } else {\n              _this8.$message.warning(response.message);\n            }\n          });\n        }\n      });\n    }\n  }\n};",null]}