{"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\\flow\\WatermarkManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\flow\\WatermarkManager.vue","mtime":1675071992835},{"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\nimport flow from \"@/api/flow.js\";\nimport uc from \"@/api/uc.js\";\nconst watermarkTypeDialog = () => import(\"@/components/flow/WatermarkTypeDialog.vue\");\nconst watermarkSetProcessDialog = () => import(\"@/components/flow/WatermarkSetProcessDialog\");\nexport default {\n  name: \"watermark-manager\",\n  components: {\n    watermarkTypeDialog,\n    watermarkSetProcessDialog\n  },\n  data() {\n    return {\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 20,\n        total: 0\n      },\n      deleteUrl: window.context.bpmModel + \"/bpmModel/bpmWatermark/v1/remove\",\n      saveUrl: window.context.bpmModel + \"/bpmModel/bpmWatermark/v1/save\",\n      dialogVisible: false,\n      typeDialogVisible: false,\n      title: \"\",\n      watermark: {\n        name: \"\",\n        type: 1,\n        content: \"\",\n        color: \"rgba(255, 69, 0, 0.68)\"\n      },\n      typeArray: [\n        { text: \"文字\", value: 1},\n        { text: \"图片\", value: 2 }\n      ],\n      selectRow: {},\n      isSubmit: true\n    }\n  },\n  methods: {\n    loadData(param, cb){\n      flow.getWatermarkList(param).then(data => {\n        this.data = data.rows;\n        this.pageResult = {\n          page: data.page,\n          pageSize: data.pageSize,\n          total: data.total\n        }\n      }).finally(() => {\n        cb && cb();\n      })\n    },\n    edit(id){\n      this.dialogVisible = true;\n      if (id){\n        this.title = \"编辑流程水印\";\n        flow.getWatermark(id).then(data => {\n          this.watermark = data;\n        });\n      }else {\n        this.title = \"添加流程水印\";\n        this.watermark = {\n          name: \"\",\n          type: 1,\n          content: \"\",\n          color: \"rgba(255, 69, 0, 0.68)\"\n        }\n      }\n    },\n    handleClose(){\n      this.dialogVisible = false;\n      this.typeDialogVisible = false;\n    },\n    beforeSaveData(){\n      this.isSubmit = true;\n      if (this.watermark.type == 2 ){\n        if (!this.watermark.content || this.watermark.content == undefined){\n          this.$message.error(\"请上传图片\");\n          this.isSubmit = false;\n        }\n      }\n    },\n    afterSaveData(){\n      this.dialogVisible = false;\n      this.$refs.htTable.load();\n    },\n    setType(row){\n      this.selectRow = {...row};\n      this.$refs.watermarkTypeDialog.showDialog();\n    },\n    setProcess(row){\n      this.selectRow = {...row};\n      this.$refs.watermarkSetProcessDialog.showDialog();\n    },\n    updateImage(param){\n      const formData = new FormData();\n      formData.append(\"files\", param.file);\n      uc.fileUpload(formData)\n        .then(response => {\n          this.$store.dispatch(\"menu/downloadImg\", response.fileId).then(res => {\n            if (res != \"\") {\n              this.$set(this.watermark,\"content\",res);\n              param.onSuccess(); // 上传成功的图片会显示绿色的对勾\n            }\n          }).catch(() => {\n            param.onError();\n          });\n        })\n        .catch(() => {\n          param.onError();\n        });\n    },\n    beforeUpload(file){\n      var fileType=file.name.substring(file.name.lastIndexOf('.')+1)\n      if (fileType!=\"jpg\" && fileType!=\"png\"){\n        this.$message.warning(\"只能上传jpg/png格式的文件\");\n        return false;\n      }else {\n        return true;\n      }\n    }\n  }\n}\n",null]}