{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\news\\PortalNewsNoticeManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\news\\PortalNewsNoticeManager.vue","mtime":1675071993022},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\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\";\nimport \"core-js/modules/es6.regexp.split\";\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//\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//\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//\nvar htMenuTree = function htMenuTree() {\n  return import(\"@/components/system/HtMenuTree.vue\");\n};\n\nvar HtEditor = function HtEditor() {\n  return import(\"@/components/common/HtEditor.vue\");\n};\n\nvar iconDialog = function iconDialog() {\n  return import(\"@/components/dialog/IconDialog.vue\");\n};\n\nvar FileUpload = function FileUpload() {\n  return import(\"@/components/common/FileUpload.vue\");\n};\n\nimport uc from \"@/api/uc.js\";\nimport req from \"@/request.js\";\nimport portal from '@/api/portal.js';\nexport default {\n  components: {\n    FileUpload: FileUpload,\n    htMenuTree: htMenuTree,\n    HtEditor: HtEditor,\n    iconDialog: iconDialog\n  },\n  data: function data() {\n    return {\n      config: {\n        initialFrameHeight: 240,\n        UEDITOR_HOME_URL: window.location.origin + '/' + window.location.pathname.split('/')[1] + '/static/ueditor/',\n        toolbars: [[// 'source', //源代码\n        'undo', //撤销\n        'bold', //加粗\n        'indent', //首行缩进\n        'italic', //斜体\n        'underline', //下划线\n        'strikethrough', //删除线\n        'subscript', //下标\n        'fontborder', //字符边框\n        'superscript', //上标\n        'formatmatch', //格式刷\n        'forecolor', //字体颜色\n        'justifyleft', //居左对齐\n        'justifycenter', //居中对齐\n        'justifyright', //居右对齐\n        'justifyjustify', //两端对齐\n        'fontfamily', //字体\n        'fontsize', //字号\n        'insertorderedlist', //有序列表\n        'insertunorderedlist', //无序列表\n        'lineheight', //行间距\n        'inserttable', //插入表格\n        'link', //超链接\n        'simpleupload', //单图上传\n        'insertimage', //多图上传\n        'attachment' //附件\n        ]],\n        // 初始容器宽度\n        initialFrameWidth: \"100%\",\n        zIndex: 9999,\n        enableAutoSave: false,\n        readonly: false\n      },\n      srcList: [this.photoUrl],\n      photoDialogVisible: true,\n      photoUrl: \"/img/defaultPhoto.jpg\",\n      selectNode: {},\n      selectTree: {},\n      treeData: [],\n      nodeDialogVisible: false,\n      treeDialogVisible: false,\n      dialogVisible: false,\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 50,\n        total: 0\n      },\n      PortalNewsTree: {\n        colHeight: 100\n      },\n      PortalNewsNotice: {\n        pageHeight: 800\n      },\n      saveMethod: \"POST\",\n      uploadUrl: \"\",\n      uploadDialogVisible: false,\n      fileList: [],\n      exportType: \"1\",\n      exportDialogVisible: false,\n      exportNode: {},\n      uploadType: \"\",\n      importClassifyId: \"\"\n    };\n  },\n  mounted: function mounted() {\n    this.$validator = this.$root.$validator;\n  },\n  created: function created() {\n    this.getTreedata();\n  },\n  methods: {\n    beforeSaveData: function beforeSaveData() {\n      if (this.$refs.newsFile.getFiles() != \"\") {\n        this.PortalNewsNotice.file = JSON.stringify(this.$refs.newsFile.getFiles());\n      }\n    },\n    selectIcon: function selectIcon(data) {\n      this.PortalNewsNotice.icon = data;\n      this.$forceUpdate();\n    },\n    issue: function issue(node, data) {\n      var _this2 = this;\n\n      req.get(\"${portal}/portalNewsTree/v1/issue?id=\" + data.id).then(function (resp) {\n        if (resp.data.state) {\n          _this2.$message({\n            message: \"操作成功!\",\n            type: \"success\"\n          });\n\n          _this2.getTreedata();\n        } else {// this.$message.error(resp.data.message);\n        }\n\n        _this2.getTreedata();\n      });\n    },\n    updateUserImage: function updateUserImage(param) {\n      var _this3 = this;\n\n      var formData = new FormData();\n      formData.append(\"files\", param.file);\n      uc.fileUpload(formData).then(function (response) {\n        _this3.PortalNewsNotice.rotatingDisplayPictures = response.fileId;\n\n        _this3.$store.dispatch(\"menu/downloadImg\", response.fileId).then(function (res) {\n          if (res != \"\") {\n            _this3.photoUrl = res;\n          }\n        });\n\n        param.onSuccess(); // 上传成功的图片会显示绿色的对勾\n      }).catch(function (response) {\n        param.onError();\n      });\n    },\n    confirmNodeClick: function confirmNodeClick() {\n      this.PortalNewsNotice.classifyId = this.selectTree.id;\n      this.PortalNewsNotice.classifyName = this.selectTree.name;\n      this.PortalNewsNotice.classifyPath = this.selectTree.path;\n\n      if (this.selectTree.path.indexOf(\"200.\") == 0) {\n        this.PortalNewsNotice.type = 1;\n      } else {\n        this.PortalNewsNotice.type = 2;\n      }\n\n      this.nodeDialogVisible = false;\n    },\n    selectNodeClick: function selectNodeClick(data, node, obj) {\n      if (data.rank != 3) {\n        this.$message.error(\"只能选择最下级菜单!\");\n      } else {\n        this.selectTree = data;\n      }\n    },\n    selectNodeFun: function selectNodeFun() {\n      this.nodeDialogVisible = true;\n    },\n    handleNodeClick: function handleNodeClick(data, node, obj) {\n      if (data.rank != 3) {\n        this.selectNode = {};\n        this.$message.error(\"只有最下级菜单才拥有数据!\");\n      } else {\n        this.selectNode = data;\n      }\n\n      this.$refs.htTable.load();\n    },\n    handleCommand: function handleCommand(obj) {\n      if (obj.action == \"add\") {\n        this.appendTree(obj.node, obj.data, obj.action);\n      } else if (obj.action == \"edit\") {\n        this.appendTree(obj.node, obj.data, obj.action);\n      } else if (obj.action == \"delete\") {\n        this.removeTree(obj.node, obj.data);\n      } else if (obj.action == \"issue\") {\n        this.issue(obj.node, obj.data);\n      } else if (obj.action == \"mobileIssue\") {\n        this.mobileIssue(obj.node, obj.data);\n      } else if (obj.action == \"mobileRemove\") {\n        this.mobileRemove(obj.node, obj.data);\n      } else if (obj.action == \"exportTree\") {\n        this.exportTree(obj.node, obj.data);\n      } else if (obj.action == 'importTree') {\n        this.importTree(obj.node, obj.data);\n      }\n    },\n    mobileIssue: function mobileIssue(node, data) {\n      var _this4 = this;\n\n      req.get(\"${portal}/portalNewsTree/v1/mobileIssue?id=\" + data.id).then(function (resp) {\n        if (resp.data.state) {\n          _this4.$message({\n            message: \"操作成功!\",\n            type: \"success\"\n          });\n\n          _this4.getTreedata();\n        }\n      });\n    },\n    mobileRemove: function mobileRemove(node, data) {\n      var _this5 = this;\n\n      req.remove(\"${portal}/portalNewsTree/v1/mobileRemove?id=\" + data.id).then(function (resp) {\n        if (resp.data.state) {\n          _this5.$message({\n            message: \"操作成功!\",\n            type: \"success\"\n          });\n\n          _this5.getTreedata();\n        }\n      });\n    },\n    appendTree: function appendTree(node, data, type) {\n      if (type == \"add\") {\n        this.PortalNewsTree.parentId = data.id;\n        this.PortalNewsTree.rank = data.rank + 1;\n        this.PortalNewsTree.parentName = data.name;\n        this.PortalNewsTree.mobileIssue = 0;\n      } else {\n        this.PortalNewsTree = data;\n      }\n\n      this.treeDialogVisible = true;\n    },\n    removeTree: function removeTree(node, data) {\n      var _this6 = this;\n\n      this.$confirm('确定要删除【' + data.name + '】吗？', '提示', {\n        confirmButtonText: \"删除\",\n        confirmButtonClass: \"el-button--danger\",\n        cancelButtonText: \"取消\",\n        type: \"warning\"\n      }).then(function () {\n        req.remove(\"${portal}/portalNewsTree/v1/\" + data.id).then(function (resp) {\n          if (resp.data.state) {\n            _this6.$message({\n              message: \"操作成功!\",\n              type: \"success\"\n            });\n\n            _this6.getTreedata();\n          } else {\n            _this6.$message.error(\"操作失败!\");\n          }\n        });\n      }).catch(function () {});\n    },\n    getTreedata: function getTreedata() {\n      var _this7 = this;\n\n      this.$http.get(\"${portal}/portalNewsTree/v1/getTree\").then(function (resp) {\n        _this7.treeData = resp.data;\n      }, function (error) {\n        reject(error);\n      });\n    },\n    showDialog: function showDialog(id) {\n      var _this8 = this;\n\n      if (id) {\n        this.saveMethod = \"PUT\";\n        this.$http.get(\"${portal}/portalNewsNotice/v1/\" + id).then(function (resp) {\n          _this8.PortalNewsNotice = resp.data;\n          var _this = _this8;\n          setTimeout(function () {\n            if (_this.PortalNewsNotice.file) {\n              _this.$refs.newsFile.setFiles(JSON.parse(_this.PortalNewsNotice.file));\n            }\n          }, 1000);\n\n          if (_this8.PortalNewsNotice.type == 1 && _this8.PortalNewsNotice.rotatingDisplayPictures) {\n            _this8.$store.dispatch(\"menu/downloadImg\", _this8.PortalNewsNotice.rotatingDisplayPictures).then(function (res) {\n              if (res != \"\") {\n                _this8.photoUrl = res;\n              }\n            });\n          }\n\n          _this8.dialogVisible = true;\n        }, function (error) {\n          reject(error);\n        });\n      } else {\n        this.PortalNewsNotice = {\n          drafter: \"\",\n          pageHeight: 800\n        };\n\n        if (sessionStorage.getItem(\"currentUser\")) {\n          var user = JSON.parse(sessionStorage.getItem(\"currentUser\"));\n          this.PortalNewsNotice.drafter = _.cloneDeep(user.username);\n        }\n\n        if (JSON.stringify(this.selectNode) !== \"{}\" && this.selectNode.rank === 3) {\n          this.PortalNewsNotice.classifyId = this.selectNode.id;\n          this.PortalNewsNotice.classifyName = this.selectNode.name;\n          this.PortalNewsNotice.classifyPath = this.selectNode.path;\n\n          if (this.selectNode.path.indexOf(\"200.\") == 0) {\n            this.PortalNewsNotice.type = 1;\n          } else {\n            this.PortalNewsNotice.type = 2;\n          }\n        }\n\n        this.saveMethod = \"POST\";\n        this.dialogVisible = true;\n      }\n    },\n    beforeCloseDialog: function beforeCloseDialog() {\n      this.$set(this, \"PortalNewsNotice\", {});\n      this.$set(this, \"photoUrl\", \"\"); // this.PortalNewsNotice = {};\n\n      this.$refs.newsFile.clearFiles();\n      this.dialogVisible = false;\n    },\n    treeBeforeCloseDialog: function treeBeforeCloseDialog() {\n      this.PortalNewsTree = {};\n      this.treeDialogVisible = false;\n    },\n    loadData: function loadData(param, cb) {\n      var _this9 = this;\n\n      if (JSON.stringify(this.selectNode) === \"{}\") {\n        cb && cb();\n        return;\n      } else {\n        if (param.querys && param.querys instanceof Array) {\n          param.querys.push({\n            property: \"classifyId\",\n            value: this.selectNode.id,\n            group: \"advance\",\n            relation: \"AND\",\n            operation: \"EQUAL\"\n          });\n        } else {\n          param.querys = [{\n            property: \"classifyId\",\n            value: this.selectNode.id,\n            group: \"advance\",\n            relation: \"AND\",\n            operation: \"EQUAL\"\n          }];\n        }\n      }\n\n      this.$http.post(\"${portal}/portalNewsNotice/v1/query\", param).then(function (resp) {\n        var response = resp.data;\n        _this9.data = response.rows;\n        _this9.pageResult = {\n          page: response.page,\n          pageSize: response.pageSize,\n          total: response.total\n        };\n      }, function (error) {\n        reject(error);\n      }).finally(function () {\n        return cb && cb();\n      });\n    },\n    afterSaveData: function afterSaveData() {\n      var _this10 = this;\n\n      setTimeout(function () {\n        _this10.beforeCloseDialog();\n\n        _this10.$refs.htTable.load();\n      }, 500);\n    },\n    treeAfterSaveData: function treeAfterSaveData() {\n      var _this11 = this;\n\n      setTimeout(function () {\n        _this11.treeBeforeCloseDialog();\n\n        _this11.getTreedata();\n      }, 500);\n    },\n    exportNews: function exportNews() {\n      var selection = this.$refs.htTable.$refs.htTable.selection;\n\n      if (!selection || selection.length == 0) {\n        this.$message.warning(\"请至少选择一条记录\");\n        return;\n      }\n\n      var ids = new Array();\n      selection.forEach(function (item) {\n        ids.push(item.id);\n      });\n      this.$http.request({\n        url: \"\".concat(window.context.portal, \"/portalNewsNotice/v1/exportNews\"),\n        method: \"POST\",\n        data: ids,\n        responseType: \"arraybuffer\"\n      });\n    },\n    beforeClose: function beforeClose() {\n      this.uploadDialogVisible = false;\n      this.fileList.splice(0);\n    },\n    handleImport: function handleImport(param) {\n      var _this12 = this;\n\n      if (this.uploadType == 'notice') {\n        var formData = new FormData();\n        formData.append(\"file\", param.file);\n        portal.importNews(formData, this.selectNode.id).then(function (resp) {\n          if (resp.state) {\n            _this12.$message.success(resp.message);\n\n            _this12.fileList.splice(0);\n\n            _this12.uploadDialogVisible = false;\n\n            _this12.$refs.htTable.load();\n          } else {\n            _this12.beforeClose();\n          }\n        });\n      } else if (this.uploadType == 'tree') {\n        var _formData = new FormData();\n\n        _formData.append(\"file\", param.file);\n\n        portal.importTree(_formData, this.importClassifyId).then(function (resp) {\n          if (resp.state) {\n            _this12.$message.success(resp.message);\n\n            _this12.fileList.splice(0);\n\n            _this12.uploadDialogVisible = false;\n\n            _this12.getTreedata();\n          } else {\n            _this12.beforeClose();\n          }\n        });\n      }\n    },\n    showImportDialog: function showImportDialog() {\n      if (!this.selectNode || this.selectNode.rank != 3) {\n        this.$message.warning(\"请先选择分类\");\n        return;\n      }\n\n      this.uploadType = \"notice\";\n      this.uploadDialogVisible = true;\n    },\n    uploadSubmit: function uploadSubmit() {\n      if (this.$refs.elUpload.uploadFiles.length == 0) {\n        this.$message.warning(\"请上传文件\");\n        return;\n      }\n\n      this.$refs.elUpload.submit();\n    },\n    exportTree: function exportTree(node, data) {\n      this.exportNode = data;\n      this.exportDialogVisible = true;\n    },\n    confirmExport: function confirmExport() {\n      var _this13 = this;\n\n      //导出分类信息\n      this.$http.request({\n        url: \"\".concat(window.context.portal, \"/portalNewsTree/v1/exportTree?exportType=\").concat(this.exportType),\n        method: \"POST\",\n        data: this.exportNode,\n        responseType: \"arraybuffer\"\n      }).then(function () {\n        _this13.exportType = \"1\";\n        _this13.exportDialogVisible = false;\n      });\n    },\n    importTree: function importTree(node, data) {\n      //导入分类信息\n      this.importClassifyId = data.id;\n      this.uploadType = \"tree\";\n      this.uploadDialogVisible = true;\n    }\n  }\n};",null]}