{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\common\\HtSubmitButton.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\common\\HtSubmitButton.vue","mtime":1667327529075},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport req from \"@/request.js\";\r\nexport default {\r\n  name: \"ht-submit-button\",\r\n  props: {\r\n    url: {\r\n      type: String,\r\n      required: true\r\n    },\r\n    requestMethod: {\r\n      type: String,\r\n      default: \"POST\"\r\n    },\r\n    model: {\r\n      type: [Object, Array],\r\n      default(){\r\n        return {};\r\n      }\r\n    },\r\n    isSubmit: {\r\n      type: Boolean,\r\n      default: true\r\n    },\r\n    type: {\r\n      type: String,\r\n      default: \"primary\"\r\n    },\r\n    scopeName: {\r\n      type: String,\r\n      required: true\r\n    },\r\n    context: {\r\n      type: String\r\n    }\r\n  },\r\n  data() {\r\n    return {\r\n      fullscreenLoading: false\r\n    };\r\n  },\r\n  computed:{\r\n    calUrl: function(){\r\n      if(this.context){\r\n        return window.context[this.context] + this.url;\r\n      }\r\n      return this.url;\r\n    }\r\n  },\r\n  mounted() {},\r\n  methods: {\r\n    async beforeSaveData() {\r\n      await this.$emit(\"before-save-data\");\r\n    },\r\n    async requestSaveData() {\r\n      this.fullscreenLoading = true;\r\n      let response = await req.request({\r\n        data: this.model,\r\n        url: this.calUrl,\r\n        method: this.requestMethod\r\n      }).finally(() => {\r\n        this.fullscreenLoading = false;\r\n      });\r\n\r\n      if (response.data && response.data.state) {\r\n        this.$emit(\"after-save-data\");\r\n        this.$message.success(response.data.message || \"操作成功\");\r\n      }\r\n    }\r\n  }\r\n};\r\n",null]}