{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/src/components/shared/FileUploader.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/src/components/shared/FileUploader.vue","mtime":1742796810167},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/babel.config.js","mtime":1742796810089},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator.js\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nimport API from \"@/api.js\";\nexport default {\n name: 'FileUploader',\n props: ['params'],\n data: function data() {\n return {\n getIndex: 0,\n categoryOkParams: [],\n visible: false,\n //外层对话框\n innerVisible: false,\n //内层对话框\n fileList: [],\n isUpload: true,\n closable: false,\n showProcess: false,\n //显示进度条\n fileId: [],\n categoryData: [],\n //标签数据\n form: {\n disks: '',\n //部门\n disksFolder: '' //文件夹\n\n },\n disksData: [],\n //部门数据\n disksFoldersList: [],\n //上传文件夹数据\n isHomeUpload: false,\n //是否是首页的上传文件\n percentageth: 0,\n //进度条初始值\n isShowProgress: false,\n //进度条是否显示\n isShowText: true,\n //进度条信息\n disabled: true,\n //上传只读\n dynamicTags: [],\n //动态贴标签\n inputVisible: false,\n //获取是否动态贴标签\n isShowTop: false,\n //是否调整外边距,上传中显示进度条要向下调整\n allfileArray: []\n };\n },\n mounted: function mounted() {\n this.getCategory();\n },\n methods: {\n /**\n * 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用\n */\n handleFileChange: function handleFileChange(file, fileList) {\n var _this = this;\n\n if (file.status == \"ready\") {\n this.fileList = fileList; //首页没有自动上传\n\n if (this.params.folderId) {\n this.isShowProgress = true;\n this.isShowTop = true;\n var interval = setInterval(function () {\n if (_this.percentageth >= 99) {\n clearInterval(interval);\n return;\n }\n\n _this.percentageth += 1;\n }, 20);\n }\n } else if (file.status == \"success\") {\n fileList.map(function (file, index) {\n file[\"isInputVisible\" + index] = false;\n file[\"inputValue\" + index] = '';\n file[\"categoryOkParams\" + index] = [];\n file[\"dynamicTags\" + index] = file.response && file.response.data && file.response.data[index] ? file.response.data[index].categorys : [];\n });\n this.fileList = fileList;\n var fileId = []; //上传成功只读为false\n\n this.disabled = false;\n this.percentageth = 100;\n setTimeout(function () {\n _this.isShowProgress = false;\n _this.isShowTop = false;\n }, 1000);\n fileList.map(function (e) {\n if (e.status == \"success\" && e.response.data != undefined) {\n fileId.push(e.response.data);\n }\n });\n this.fileId = fileId;\n } else if (file.status == \"fail\") {\n this.$message({\n type: 'info',\n message: this.$t('msg.upload_err')\n });\n } //当没有folderId时,手动上传\n\n\n if (!this.params.folderId && file.status != \"success\") {\n this.visible = true;\n this.isHomeUpload = true;\n\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n keyWord: this.params.keyWord,\n linesPerPage: 999,\n operationType: this.params.operationType,\n pageNo: this.params.pageNo,\n userid: this.params.userid\n });\n\n API.getdisksData(params, {\n onSucess: function onSucess(resp) {\n if (resp.data.errcode == 0) {\n _this.disksData = resp.data.data.datas;\n }\n }\n });\n }\n },\n fileUpload: function fileUpload(e) {\n var _this2 = this;\n\n //上传一次就触发一次\n console.log(e);\n var ob = {};\n ob.uid = e.file.uid;\n ob.name = e.file.name;\n ob.marks = 0;\n ob.marksValue = '0%';\n this.allfileArray.push(ob);\n var fileArray = e.file;\n var file = fileArray;\n var that = this;\n var form = new FormData();\n form.append(\"files\", file);\n var files = form;\n API.fileUpload(e.data.diskId, e.data.folderId, files, {\n onSucess: function onSucess(resp) {\n var flieIdsign = true;\n _this2.isShowText = false;\n _this2.disabled = false;\n var fileList = _this2.fileList;\n var fileId = [];\n fileList.map(function (file, index) {\n file[\"isInputVisible\" + index] = false;\n file[\"inputValue\" + index] = '';\n file[\"categoryOkParams\" + index] = [];\n file[\"dynamicTags\" + index] = resp.data.data && resp.data.data[index] ? resp.data.data[index].categorys : []; // fileId.push(resp.data.data);\n // file['fileId'] = resp.data.data[0].fileId\n\n if (!file['fileId'] && file.name == ob.name) {\n file['fileId'] = resp.data.data[0].fileId;\n }\n });\n _this2.fileList = fileList; // this.fileId = fileId;\n\n _this2.fileId.unshift(resp.data.data); //由于上传文件的文件,在后台生成fileid,没有与上传文件的内容自动对应,下面的函数是为了让文件和fileid对应而设置的\n\n\n if (_this2.fileId.length === _this2.fileList.length) {\n for (var i = 0; _this2.fileId.length > i; i++) {\n _this2.fileId[i][0].fileId = _this2.fileList[i].fileId;\n }\n }\n\n for (var _i = 0; _i < _this2.allfileArray.length; _i++) {\n if (e.file.uid === _this2.allfileArray[_i].uid) {\n _this2.allfileArray.splice(_i, 1);\n\n _i--;\n }\n }\n }\n }, function (res) {\n for (var i = 0; i < _this2.allfileArray.length; i++) {\n if (res.uid === _this2.allfileArray[i].uid) {\n _this2.allfileArray[i].marks = res.num;\n _this2.allfileArray[i].marksValue = res.complete;\n\n _this2.$forceUpdate();\n }\n }\n }, e.file.uid);\n },\n\n /**\n * 上传文件之前的钩子,参数为上传的文件\n */\n handleBeforeUpload: function handleBeforeUpload() {\n if (this.params.folderId) {\n var uploader = true;\n this.visible = true;\n return uploader;\n }\n },\n\n /**\n * 获取标签数据\n */\n getCategory: function () {\n var _getCategory = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(isAutoCategory) {\n var categorySettingsData;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return API.getCategory();\n\n case 2:\n categorySettingsData = _context.sent.data;\n this.categoryData = categorySettingsData.data; // this.$nextTick(()=>{\n // // this.$refs.upload\n // document.getElementsByClassName(\n // \"el-upload__input\"\n // )[0].webkitdirectory=true;\n // })\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getCategory(_x) {\n return _getCategory.apply(this, arguments);\n }\n\n return getCategory;\n }(),\n\n /**\n * 删除动态标签\n */\n handleTagClose: function handleTagClose(tag, index) {\n var _this3 = this;\n\n this.$confirm(this.$t('msg.sure_delete_tag'), this.$t('msg.tip'), {\n confirmButtonText: this.$t('msg.delete'),\n cancelButtonText: this.$t('msg.cancel'),\n type: 'warning'\n }).then(function () {\n var that = _this3;\n API.getLabelTreeDelete([tag.categoryId], {\n onSucess: function onSucess(resp) {\n if (resp.data.errcode == 0) {\n var fileListIndex;\n that.fileList[index]['dynamicTags' + index].map(function (fileType, i) {\n if (fileType.categoryId == tag.categoryId) {\n fileListIndex = i;\n }\n });\n that.fileList[index]['dynamicTags' + index].splice(fileListIndex, 1);\n that.$forceUpdate();\n\n _this3.$message({\n type: 'success',\n message: _this3.$t('msg.es')\n });\n }\n }\n });\n }).catch(function () {\n _this3.$message({\n type: 'info',\n message: _this3.$t('msg.cancel_del')\n });\n });\n },\n\n /**\n * 防止自动贴标签input框不能连续输入\n */\n hanleInputChange: function hanleInputChange(e) {\n this.$forceUpdate();\n },\n\n /**\n * 创建标签\n */\n showInput: function showInput(val) {\n var _this4 = this;\n\n // this.inputVisible = true;\n this.fileList[val][\"isInputVisible\" + val] = true;\n this.$forceUpdate();\n this.$nextTick(function (_) {\n if (_this4.$refs.saveTagInput[val]) {\n _this4.$refs.saveTagInput[val].$refs.input.focus();\n }\n });\n },\n\n /**\n * 动态添加标签\n */\n handleInputConfirm: function handleInputConfirm(val) {\n var _this5 = this;\n\n var inputValue = this.fileList[val][\"inputValue\" + val];\n\n if (inputValue) {\n var dataJson = {};\n dataJson.name = inputValue.replace(/^\\s*|\\s*$/g, '').split(/[(\\r\\n)\\r\\n]+/);\n dataJson.parentId = '';\n API.getLabelTreeAdd(dataJson, {\n onSucess: function onSucess(resp) {\n if (resp.data.errcode == 0) {\n var data = resp.data.data;\n var fileArr = [];\n data.map(function (data) {\n var json = {};\n json.categoryName = data.name;\n json.categoryId = data.id;\n fileArr.push(json);\n fileArr = _this5.fileList[val][\"dynamicTags\" + val].concat(fileArr);\n });\n _this5.fileList[val][\"dynamicTags\" + val] = fileArr;\n _this5.fileList[val][\"isInputVisible\" + val] = false;\n _this5.fileList[val][\"inputValue\" + val] = '';\n\n _this5.$forceUpdate();\n\n _this5.getCategory();\n }\n },\n onError: function onError(error) {\n _this5.$message({\n type: 'warning',\n message: error.response.data.errmsg\n });\n\n _this5.fileList[val][\"isInputVisible\" + val] = false;\n _this5.fileList[val][\"inputValue\" + val] = '';\n\n _this5.$forceUpdate();\n }\n });\n } else {\n this.fileList[val][\"isInputVisible\" + val] = false;\n this.$message({\n message: this.$t('msg.names_cannot_empty'),\n type: 'warning'\n });\n this.$forceUpdate();\n return false;\n }\n },\n\n /**\n * 选择标签\n */\n hanleClickCheked: function hanleClickCheked(index) {\n this.categoryOkParams = [];\n this.getCategory();\n this.getIndex = index;\n this.innerVisible = true;\n var arr = [];\n var categoryList = this.categoryData;\n var addCatefory = this.fileList[index]['dynamicTags' + index];\n\n for (var i = 0; i < categoryList.length; i++) {\n for (var y = 0; y < addCatefory.length; y++) {\n if (addCatefory[y].categoryId == categoryList[i].id) {\n arr.push(categoryList[i].id);\n }\n }\n }\n\n this.categoryOkParams = arr;\n this.$forceUpdate();\n },\n\n /**\n * 添加标签,回调到上传标签点击事件\n */\n hanleClickAddTag: function hanleClickAddTag() {\n var categoryList = this.categoryData;\n var checkedList = this.categoryOkParams;\n var index = this.getIndex;\n var arr = [];\n\n for (var i = 0; i < checkedList.length; i++) {\n for (var y = 0; y < categoryList.length; y++) {\n if (checkedList[i] == categoryList[y].id) {\n var categoryObj = {};\n categoryObj.categoryName = categoryList[y].name;\n categoryObj.categoryId = categoryList[y].id;\n arr.push(categoryObj);\n }\n }\n }\n\n var addCatefory = this.fileList[index]['dynamicTags' + index];\n var newArr = [];\n\n for (var a = 0; a < arr.length; a++) {\n var ischecked = false;\n\n for (var b = 0; b < addCatefory.length; b++) {\n if (arr[a].categoryId == addCatefory[b].categoryId) {\n ischecked = true;\n }\n }\n\n if (!ischecked) {\n newArr = newArr.concat(arr[a]);\n }\n }\n\n this.fileList[index]['dynamicTags' + index] = this.fileList[index]['dynamicTags' + index].concat(newArr);\n this.$forceUpdate();\n this.innerVisible = false;\n },\n\n /**\n * 组装包体数据\n */\n documentItem: function documentItem(fileId, categoryData, defaultValue, categorySettingsArr, a) {\n if (categoryData) {\n for (var y = 0; y < defaultValue.length; y++) {\n for (var i = 0; i < categoryData.length; i++) {\n if (defaultValue[y] == categoryData[i].id || defaultValue[y] == categoryData[i].name) {\n var categorySettingsJson = {};\n categorySettingsJson.categoryName = categoryData[i].name;\n categorySettingsJson.categoryId = categoryData[i].id;\n categorySettingsJson.isAuto = false;\n categorySettingsArr.push(categorySettingsJson);\n }\n }\n }\n }\n\n if (!a) {\n a = 0;\n }\n\n var json = {};\n\n if (typeof fileId == \"string\") {\n json.fileId = fileId;\n json.categorys = categorySettingsArr;\n } else {\n json.fileId = fileId[a][0].fileId;\n json.categorys = categorySettingsArr;\n }\n\n return json;\n },\n\n /**\n * 确定\n */\n handleSettingsOk: function () {\n var _handleSettingsOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var _this6 = this;\n\n var fileId, categoryData, defaultValue, categorySettingsArr, that, dynamicTagsList, list, doc, arr;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n fileId = this.fileId; //fileId是上传文件后,后台返回的一个id,首页上传按钮没有真实上传,故不展示贴标签\n\n if (!(fileId && fileId.length > 0)) {\n _context2.next = 26;\n break;\n }\n\n categoryData = this.categoryData;\n categorySettingsArr = [];\n that = this; //单个贴标签\n\n if (!(this.fileList.length == 1)) {\n _context2.next = 16;\n break;\n }\n\n //标签分类属性\n defaultValue = this.fileList[0].categoryOkParams0; //贴标签\n\n dynamicTagsList = this.fileList[0].dynamicTags0;\n list = [];\n\n if (dynamicTagsList && dynamicTagsList.length > 0) {\n dynamicTagsList.map(function (tagsList) {\n list.push(tagsList.categoryName);\n });\n }\n\n defaultValue = list.concat(defaultValue);\n doc = this.documentItem(fileId, categoryData, defaultValue, categorySettingsArr);\n _context2.next = 14;\n return API.onePasteConfirm(doc);\n\n case 14:\n _context2.next = 20;\n break;\n\n case 16:\n arr = [];\n this.fileList.map(function (fileList, a) {\n defaultValue = fileList['categoryOkParams' + a]; //判断是否自己添加标签\n\n var autoCategory = fileList[\"dynamicTags\" + a];\n\n if (autoCategory.length > 0) {\n var autoArr = [];\n autoCategory.map(function (autoData) {\n autoArr.push(autoData.categoryName);\n });\n defaultValue = autoArr.concat(defaultValue);\n }\n\n var categorySettingsArr = [];\n\n var doc = _this6.documentItem(fileId, categoryData, defaultValue, categorySettingsArr, a);\n\n arr.push(doc);\n });\n _context2.next = 20;\n return API.pasteConfirm(arr);\n\n case 20:\n this.$emit('onRefreshComponent', this.params);\n this.fileList = [];\n this.categoryOkParams = [];\n this.visible = false;\n _context2.next = 27;\n break;\n\n case 26:\n if (this.params.folderId) {\n this.$message({\n message: this.$t('msg.file_being_uploaded'),\n type: 'warning'\n });\n } else {\n if (this.form.disks == \"\" || this.form.disksFolder == \"\") {\n this.$message.error(this.$t('msg.location_sl_d_f'));\n } else {\n this.$refs.upload.submit();\n this.form = {\n disks: '',\n //部门\n disksFolder: '' //文件夹\n\n };\n this.$message({\n message: this.$t('msg.upload_ss'),\n type: 'success'\n });\n this.$emit('onRefreshHome', true);\n this.fileList = [];\n this.categoryOkParams = [];\n this.visible = false;\n }\n }\n\n case 27:\n this.fileId = [];\n this.fileList = [];\n this.$forceUpdate();\n\n case 30:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function handleSettingsOk() {\n return _handleSettingsOk.apply(this, arguments);\n }\n\n return handleSettingsOk;\n }(),\n\n /**\n * 取消\n */\n handleClose: function handleClose() {\n //当取消时,将上传的文件删除\n var json = [];\n\n if (this.params.folderId) {\n //判断是否是首页上传文件,首页没有folderId\n var isFileId = false; //有fileId才能进行删除\n\n this.fileList.map(function (fileList) {\n if (fileList.response) {\n fileList.response.data.map(function (data) {\n var arr = {};\n data.fileId ? isFileId = true : isFileId = false;\n arr.fileObjectId = data.fileId;\n arr.isFolder = false;\n json.push(arr);\n });\n } else {\n var arr = {};\n fileList.fileId ? isFileId = true : isFileId = false;\n arr.fileObjectId = fileList.fileId;\n arr.isFolder = false;\n json.push(arr);\n }\n });\n\n if (isFileId) {\n var uploadFile = {\n diskId: this.params.diskId,\n fileObject: json\n };\n this.$emit('deleteUploadFile', uploadFile, this.params);\n }\n } else {\n this.$emit('onRefreshComponent', this.params);\n this.$message(this.$t('msg.upload_ca'));\n }\n\n this.fileList = [];\n this.visible = false;\n },\n\n /**\n * 获取上传文件夹\n */\n disksChange: function disksChange(id) {\n var _this7 = this;\n\n var params = {\n diskId: id,\n pageNo: 1,\n linesPerPage: 1000\n };\n this.disabled = true;\n var user = this.$store.state.user;\n this.disksData.map(function (depart) {\n if (depart.id == id) {\n /**\n * 判断是否有权上传\n * 1.企业域管理员\n * 2.该部门下的管理员(企业知识管理员)\n */\n if (depart.ownerId == user.defaultDepartment || user.level == 100) {\n _this7.disabled = false;\n }\n }\n }); //将文件夹选择清空\n\n this.form.disksFolder = \"\";\n this.disksFoldersList = [];\n API.getDisksFoldersList(params, {\n onSucess: function onSucess(resp) {\n if (resp.data.errcode == 0) {\n var datas = resp.data.data.datas; //当只有文件夹才显示\n\n var arr = [];\n datas.map(function (folder) {\n if (folder.folder) {\n arr.push(folder);\n }\n });\n _this7.disksFoldersList = arr;\n }\n }\n });\n }\n }\n};",null]}