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