{"remainingRequest":"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\\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":["//\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 {\n\tfail\n} from 'assert'\nimport {\n\tmapState\n} from 'vuex'\nexport default {\n\tname: 'zlxxMenuDialog',\n\tcomponents: {\n\t\tSelectOrganize,\n\t\tSelectUser\n\t},\n\tdata() {\n\t\treturn {\n\t\t\t// 附件上传\n\t\t\tfileList: [],\n\t\t\tuploadUrl: window.context.portal + '/file/v1/fileUpload', // 服务器上传地址\n\t\t\taccept: '.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\t\t\tpreviewUrl: window.context.portal + '/file/v1/downloadFile?fileId=',\n\t\t\t// \n\t\t\ttitle: '新增',\n\t\t\tvisible: false,\n\t\t\tparameter: {\n\t\t\t\texamFiles: [],\n\t\t\t\texamMaterialVo: {\n\t\t\t\t\taccessControlList: [],\n\t\t\t\t\taccessControlType: \"\",\n\t\t\t\t\tauthType: \"\",\n\t\t\t\t\ttypeId: \"\"\n\t\t\t\t},\n\t\t\t\tkeyword: \"\",\n\t\t\t\tmemo: \"\",\n\t\t\t\ttitle: \"\",\n\t\t\t\ttypeId: \"\",\n\t\t\t},\n\t\t\tMaterialDataType: [],\n\t\t\trules: {\n\t\t\t\ttitle: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入资料名称',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\ttypeId: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请选择资料分类',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t\tkeyword: [{\n\t\t\t\t\trequired: true,\n\t\t\t\t\tmessage: '请输入关键词',\n\t\t\t\t\ttrigger: 'blur',\n\t\t\t\t}, ],\n\t\t\t},\n\t\t\tmaterialTypeList: [],\n\t\t\taccessControlTypeList: [],\n\t\t\t// 组织列表\n\t\t\tOrgsLists: [],\n\t\t\tOrgsListIds: [],\n\t\t\t// 用户列表\n\t\t\tUsersListIds: [],\n\t\t\tUsersList: [],\n\t\t}\n\t},\n\tcreated() {\n\t\tthis.accessControlTypeList = dictUtils.getDictItemsFromCache('qxsklx')\n\t},\n\tmounted() {\n\t\t// ref绑定自定义事件\n\t\tthis.$refs.OrgsModal.$on('getOrgs', this.getOrg)\n\t\tthis.$refs.UsersModal.$on('getUser', this.getUser)\n\t},\n\tcomputed: mapState({\n\t\theader: (state) => {\n\t\t\treturn {\n\t\t\t\tAuthorization: `Bearer ${state.login.currentUser.token}`,\n\t\t\t}\n\t\t},\n\t}),\n\tmethods: {\n\t\t// 附件上传\n\t\tuploadSuccess(res) {\n\t\t\tif (res) {\n\t\t\t\t// this.parameter.examFiles = []\n\t\t\t\tthis.parameter.examFiles.push({\n\t\t\t\t\tfileName: res.fileName,\n\t\t\t\t\tid: res.fileId,\n\t\t\t\t\tfileUrl: this.previewUrl + res.fileId,\n\t\t\t\t\tfileSizes: res.size,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\t// 提示信息,需引入Message\n\t\t\t\tthis.$message.error('上传失败!')\n\t\t\t}\n\t\t},\n\t\tbeforeUpload(file) {\n\t\t\treturn true\n\t\t},\n\t\t// 文件移除\n\t\tbeforeRemove(file, fileList) {\n\t\t\tzlxxMenu.removeFile(file.id, res => {\n\t\t\t\tif (res.state) {\n\t\t\t\t\tthis.parameter.examFiles.forEach(function(item, index, arr) {\n\t\t\t\t\t\tif (file.id == item.id) {\n\t\t\t\t\t\t\tarr.splice(index, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\tmessage: '删除成功',\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tclearData() {\n\t\t\tif (this.parameter.examMaterialVo.accessControlType == \"1\") {\n\t\t\t\tthis.UsersList = []\n\t\t\t\tthis.UsersListIds = []\n\t\t\t\tthis.OrgsLists = []\n\t\t\t\tthis.OrgsListIds = []\n\t\t\t}\n\t\t\tif (this.parameter.examMaterialVo.accessControlType == \"2\") {\n\t\t\t\tthis.UsersList = []\n\t\t\t\tthis.UsersListIds = []\n\t\t\t}\n\t\t\tif (this.parameter.examMaterialVo.accessControlType == \"3\") {\n\t\t\t\tthis.OrgsLists = []\n\t\t\t\tthis.OrgsListIds = []\n\t\t\t}\n\t\t},\n\t\tselectOne(val) {\n\t\t\tlet arr = JSON.parse(JSON.stringify(this.OrgsLists))\n\t\t\tthis.OrgsLists = []\n\t\t\tarr.forEach((p, pi) => {\n\t\t\t\tval.forEach(v => {\n\t\t\t\t\tif (p.accessControlId == v) {\n\t\t\t\t\t\tthis.OrgsLists.push(p)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t})\n\t\t},\n\t\tselectTwo(val) {\n\t\t\tlet arr = JSON.parse(JSON.stringify(this.UsersList))\n\t\t\tthis.UsersList = []\n\t\t\tarr.forEach((p, pi) => {\n\t\t\t\tval.forEach(v => {\n\t\t\t\t\tif (p.accessControlId == v) {\n\t\t\t\t\t\tthis.UsersList.push(p)\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t})\n\t\t},\n\t\tclear() {\n\t\t\tthis.OrgsListIds = []\n\t\t\tthis.OrgsLists = []\n\t\t\tthis.UsersListIds = []\n\t\t\tthis.UsersList = []\n\t\t},\n\t\tselectOrgs() {\n\t\t\tthis.$refs.OrgsModal.handleShow(this.OrgsLists)\n\t\t},\n\t\tselectUsers() {\n\t\t\tthis.$refs.UsersModal.handleShow(this.UsersList)\n\t\t},\n\t\tgetOrg(item) {\n\t\t\tconsole.log(item);\n\t\t\tthis.OrgsListIds = []\n\t\t\tthis.OrgsLists = item\n\t\t\tthis.OrgsLists.forEach(item => {\n\t\t\t\tthis.OrgsListIds.push(item.accessControlId)\n\t\t\t})\n\t\t},\n\t\tgetUser(item) {\n\t\t\tthis.UsersListIds = []\n\t\t\tthis.UsersList = item\n\t\t\tthis.UsersList.forEach(item => {\n\t\t\t\tthis.UsersListIds.push(item.accessControlId)\n\t\t\t})\n\t\t},\n\t\t// 获取树\n\t\tgetTreen() {\n\t\t\tzlxxMenu.getMaterTree({\n\t\t\t\tid: '0'\n\t\t\t}, res => {\n\t\t\t\tthis.MaterialDataType = res.value\n\t\t\t\tthis.$set(this.MaterialDataType)\n\t\t\t})\n\t\t},\n\t\t// id查询详情\n\t\tgetdetail(id) {\n\t\t\tthis.UsersList = []\n\t\t\tthis.UsersListIds = []\n\t\t\tthis.OrgsLists = []\n\t\t\tthis.OrgsListIds = []\n\t\t\tzlxxMenu.detailId(id, res => {\n\t\t\t\tthis.parameter = res\n\t\t\t\tif (this.parameter.examMaterialVo.accessControlType == 2) {\n\t\t\t\t\tthis.OrgsLists = this.parameter.examMaterialVo.accessControlList\n\t\t\t\t\tthis.OrgsLists.forEach(s => {\n\t\t\t\t\t\tthis.OrgsListIds.push(s.accessControlId)\n\t\t\t\t\t})\n\t\t\t\t} else if (this.parameter.examMaterialVo.accessControlType == 3) {\n\t\t\t\t\tthis.UsersList = this.parameter.examMaterialVo.accessControlList\n\t\t\t\t\tthis.UsersList.forEach(s => {\n\t\t\t\t\t\tthis.UsersListIds.push(s.accessControlId)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tthis.parameter.examFiles.forEach(item => {\n\t\t\t\t\tthis.fileList.push({\n\t\t\t\t\t\tname: item.fileName,\n\t\t\t\t\t\turl: item.fileUrl,\n\t\t\t\t\t\t// id: item.id\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\t\thandleChange(val) {\n\t\t\tlet ArrIds = []\n\t\t\tArrIds = val\n\t\t\tif (ArrIds.length == 0) {\n\t\t\t\tthis.parameter.typeId = ArrIds[0];\n\t\t\t} else {\n\t\t\t\tthis.parameter.typeId = ArrIds[val.length - 1];\n\t\t\t}\n\t\t},\n\t\tadd(val) {\n\t\t\tthis.title = '新增'\n\t\t\tthis.visible = true\n\t\t\tthis.getTreen()\n\t\t},\n\t\tedit(val) {\n\t\t\tthis.title = '修改'\n\t\t\tthis.visible = true\n\t\t\tthis.getTreen()\n\t\t\tthis.getdetail(val.id)\n\t\t},\n\t\t// 关闭新增人员窗口\n\t\thandleClose() {\n\t\t\tthis.visible = false\n\t\t\tthis.title = '新增'\n\t\t\tthis.parameter = {\n\t\t\t\texamFiles: [],\n\t\t\t\texamMaterialVo: {\n\t\t\t\t\taccessControlList: [],\n\t\t\t\t\taccessControlType: \"\",\n\t\t\t\t\tauthType: \"\",\n\t\t\t\t\ttypeId: \"\"\n\t\t\t\t},\n\t\t\t\tkeyword: \"\",\n\t\t\t\tmemo: \"\",\n\t\t\t\ttitle: \"\",\n\t\t\t\ttypeId: \"\",\n\t\t\t}\n\t\t\tthis.fileList = []\n\t\t},\n\t\t// 保存产品类型\n\t\thandleSave() {\n\t\t\tthis.parameter.examMaterialVo.accessControlList = []\n\t\t\tif(this.parameter.examFiles.length>0){\n\t\t\t\tthis.parameter.examFiles.forEach(e=>{\n\t\t\t\t\tdelete e.createTime\n\t\t\t\t\tdelete e.fileExt\n\t\t\t\t\tdelete e.fileType\n\t\t\t\t\tdelete e.isDele\n\t\t\t\t\tdelete e.materialId\n\t\t\t\t\tdelete e.pkVal\n\t\t\t\t\tdelete e.id\n\t\t\t\t})\n\t\t\t}\n\t\t\t\n\t\t\tif (this.OrgsLists.length != 0) {\n\t\t\t\t// this.OrgsLists.forEach(item => {\n\t\t\t\t// \tlet obj = {}\n\t\t\t\t// \tobj[\"accessControlId\"] = item.id\n\t\t\t\t// \tobj[\"accessControlName\"] = item.name\n\t\t\t\t// \tthis.parameter.examMaterialVo.accessControlList.push(obj)\n\t\t\t\t// })\n\t\t\t\tthis.parameter.examMaterialVo.accessControlList = this.OrgsLists\n\t\t\t}\n\t\t\tif (this.UsersList.length != 0) {\n\t\t\t\t// this.UsersList.forEach(item => {\n\t\t\t\t// \tlet obj = {}\n\t\t\t\t// \tobj[\"accessControlId\"] = item.id\n\t\t\t\t// \tobj[\"accessControlName\"] = item.fullname\n\t\t\t\t// \tthis.parameter.examMaterialVo.accessControlList.push(obj)\n\t\t\t\t// })\n\t\t\t\tthis.parameter.examMaterialVo.accessControlList = this.UsersList\n\t\t\t}\n\t\t\t\n\t\t\tthis.$refs.formInfo.validate(valid => {\n\t\t\t\tif (valid) {\n\t\t\t\t\tlet method\n\t\t\t\t\tif (this.title === '新增') {\n\t\t\t\t\t\tmethod = zlxxMenu.addMaterial\n\t\t\t\t\t}\n\t\t\t\t\tif (this.title === '修改') {\n\t\t\t\t\t\tmethod = zlxxMenu.editMaterial\n\t\t\t\t\t}\n\t\t\t\t\tmethod(this.parameter, response => {\n\t\t\t\t\t\tif (response.state) {\n\t\t\t\t\t\t\tthis.$notify({\n\t\t\t\t\t\t\t\ttype: 'success',\n\t\t\t\t\t\t\t\tmessage: this.title + '成功',\n\t\t\t\t\t\t\t\tduration: 2000\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tthis.handleClose()\n\t\t\t\t\t\t\tthis.$emit('loadData')\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$message.warning(response.message)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\n\t\t}\n\t}\n}\n",null]}