eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_InstanceDetail__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/InstanceDetail */ \"./src/components/common/InstanceDetail.vue\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"InstanceManager\",\n components: {\n InstanceDetail: _common_InstanceDetail__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n data() {\n return {\n // 实例查询对象\n instanceQueryContent: {\n appId: window.localStorage.getItem(\"Power_appId\"),\n index: 0,\n pageSize: 10,\n instanceId: undefined,\n wfInstanceId: undefined,\n status: \"\",\n jobId: undefined,\n type: \"NORMAL\"\n },\n // 实例查询结果\n instancePageResult: {\n pageSize: 10,\n totalItems: 0,\n data: []\n },\n // 详细信息弹出框是否可见\n instanceDetailVisible: false,\n // 日志查询对象\n logQueryContent: {\n instanceId: undefined,\n index: 0\n },\n // 日志对象\n paginableInstanceLog: {\n index: 0,\n totalPages: 0,\n data: \"\"\n },\n // 日志弹出框是否可见\n instanceLogVisible: false,\n currentInstanceId: undefined,\n // 任务实例状态选择\n instanceStatusOptions: [{\n key: \"\",\n label: this.$t(\"message.all\")\n }, {\n key: \"WAITING_DISPATCH\",\n label: this.$t(\"message.waitingDispatch\")\n }, {\n key: \"WAITING_WORKER_RECEIVE\",\n label: this.$t(\"message.waitingWorkerReceive\")\n }, {\n key: \"RUNNING\",\n label: this.$t(\"message.running\")\n }, {\n key: \"FAILED\",\n label: this.$t(\"message.failed\")\n }, {\n key: \"SUCCEED\",\n label: this.$t(\"message.success\")\n }, {\n key: \"CANCELED\",\n label: this.$t(\"message.canceled\")\n }, {\n key: \"STOPPED\",\n label: this.$t(\"message.stopped\")\n }]\n };\n },\n methods: {\n // 查询任务实例信息\n listInstanceInfos() {\n let that = this;\n that.axios.post(\"/instance/list\", that.instanceQueryContent).then(res => {\n that.instancePageResult = res;\n });\n },\n // 点击重置按钮\n onClickRest() {\n this.instanceQueryContent.jobId = undefined;\n this.instanceQueryContent.instanceId = undefined;\n this.instanceQueryContent.wfInstanceId = undefined;\n this.instanceQueryContent.status = \"\";\n this.listInstanceInfos();\n },\n // 点击查询详情\n onClickShowDetail(data) {\n this.instanceDetailVisible = true;\n this.currentInstanceId = data.instanceId;\n },\n // 点击重跑\n onClickRetryJob(data) {\n let that = this;\n let url = \"/instance/retry?instanceId=\" + data.instanceId + \"&appId=\" + window.localStorage.getItem(\"Power_appId\");\n this.axios.get(url).then(() => {\n that.$message.success(this.$t(\"message.success\"));\n that.listInstanceInfos();\n });\n },\n // 点击停止实例\n onClickStop(data) {\n let that = this;\n let url = \"/instance/stop?instanceId=\" + data.instanceId + \"&appId=\" + window.localStorage.getItem(\"Power_appId\");\n this.axios.get(url).then(() => {\n that.$message.success(this.$t(\"message.success\"));\n // 重新加载列表\n that.listInstanceInfos();\n });\n },\n // 换页\n onClickChangeInstancePage(index) {\n // 后端从0开始,前端从1开始\n this.instanceQueryContent.index = index - 1;\n this.listInstanceInfos();\n },\n instanceTableRowClassName({\n row\n }) {\n switch (row.status) {\n // 失败\n case 4:\n return \"error-row\";\n // 成功\n case 5:\n return \"success-row\";\n case 9:\n case 10:\n return \"warning-row\";\n }\n },\n // 查看日志\n queryLog() {\n let that = this;\n let url = \"/instance/log?instanceId=\" + this.logQueryContent.instanceId + \"&index=\" + this.logQueryContent.index + \"&appId=\" + window.localStorage.getItem(\"Power_appId\");\n this.axios.get(url).then(res => {\n that.paginableInstanceLog = res;\n that.instanceLogVisible = true;\n });\n },\n // 查看在线日志\n onClickShowLog(data) {\n this.logQueryContent.instanceId = data.instanceId;\n this.logQueryContent.index = 0;\n this.queryLog();\n },\n // 查看其它页的在线日志\n onClickChangeLogPage(index) {\n this.logQueryContent.index = index - 1;\n this.queryLog();\n },\n // 下载日志\n onclickDownloadLog() {\n let url = \"/instance/downloadLogUrl?instanceId=\" + this.logQueryContent.instanceId + \"&appId=\" + window.localStorage.getItem(\"Power_appId\");\n this.axios.get(url).then(res => window.open(res));\n },\n // 获取状态\n fetchStatus(s) {\n return this.common.translateInstanceStatus(s);\n }\n },\n mounted() {\n // 读取传递的参数\n let jobId = this.$route.params.jobId;\n if (jobId !== undefined) {\n this.instanceQueryContent.jobId = jobId;\n }\n this.listInstanceInfos();\n }\n});\n\n//# sourceURL=webpack:///./src/components/views/InstanceManager.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options");
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n attrs: {\n id: \"instance_manager\"\n }\n }, [_c(\"el-row\", [_c(\"el-col\", {\n attrs: {\n span: 22\n }\n }, [_c(\"el-form\", {\n staticClass: \"el-form--inline\",\n attrs: {\n inline: true,\n model: _vm.instanceQueryContent\n }\n }, [_c(\"el-form-item\", {\n attrs: {\n label: _vm.$t(\"message.jobId\")\n }\n }, [_c(\"el-input\", {\n attrs: {\n placeholder: _vm.$t(\"message.jobId\")\n },\n model: {\n value: _vm.instanceQueryContent.jobId,\n callback: function ($$v) {\n _vm.$set(_vm.instanceQueryContent, \"jobId\", $$v);\n },\n expression: \"instanceQueryContent.jobId\"\n }\n })], 1), _c(\"el-form-item\", {\n attrs: {\n label: _vm.$t(\"message.instanceId\")\n }\n }, [_c(\"el-input\", {\n attrs: {\n placeholder: _vm.$t(\"message.instanceId\")\n },\n model: {\n value: _vm.instanceQueryContent.instanceId,\n callback: function ($$v) {\n _vm.$set(_vm.instanceQueryContent, \"instanceId\", $$v);\n },\n expression: \"instanceQueryContent.instanceId\"\n }\n })], 1), _vm.instanceQueryContent.type === \"WORKFLOW\" ? _c(\"el-form-item\", {\n attrs: {\n label: _vm.$t(\"message.wfInstanceId\")\n }\n }, [_c(\"el-input\", {\n attrs: {\n placeholder: _vm.$t(\"message.wfInstanceId\")\n },\n model: {\n value: _vm.instanceQueryContent.wfInstanceId,\n callback: function ($$v) {\n _vm.$set(_vm.instanceQueryContent, \"wfInstanceId\", $$v);\n },\n expression: \"instanceQueryContent.wfInstanceId\"\n }\n })], 1) : _vm._e(), _c(\"el-form-item\", {\n attrs: {\n label: _vm.$t(\"message.status\")\n }\n }, [_c(\"el-select\", {\n attrs: {\n placeholder: _vm.$t(\"message.status\")\n },\n model: {\n value: _vm.instanceQueryContent.status,\n callback: function ($$v) {\n _vm.$set(_vm.instanceQueryContent, \"status\", $$v);\n },\n expression: \"instanceQueryContent.status\"\n }\n }, _vm._l(_vm.instanceStatusOptions, function (item) {\n return _c(\"el-option\", {\n key: item.key,\n attrs: {\n label: item.label,\n value: item.key\n }\n });\n }), 1)], 1), _c(\"el-form-item\", [_c(\"el-button\", {\n attrs: {\n type: \"primary\"\n },\n on: {\n click: _vm.listInstanceInfos\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.query\")))]), _c(\"el-button\", {\n attrs: {\n type: \"cancel\"\n },\n on: {\n click: _vm.onClickRest\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.reset\")))])], 1)], 1)], 1), _c(\"el-col\", {\n attrs: {\n span: 2\n }\n }, [_c(\"div\", {\n staticStyle: {\n float: \"right\",\n \"padding-right\": \"10px\"\n }\n }, [_c(\"el-button\", {\n attrs: {\n type: \"primary\"\n },\n on: {\n click: _vm.listInstanceInfos\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.refresh\")))])], 1)])], 1), _c(\"el-tabs\", {\n attrs: {\n type: \"card\"\n },\n on: {\n \"tab-click\": _vm.listInstanceInfos\n },\n model: {\n value: _vm.instanceQueryContent.type,\n callback: function ($$v) {\n _vm.$set(_vm.instanceQueryContent, \"type\", $$v);\n },\n expression: \"instanceQueryContent.type\"\n }\n }, [_c(\"el-tab-pane\", {\n attrs: {\n label: _vm.$t(\"message.normalInstance\"),\n name: \"NORMAL\"\n }\n }), _c(\"el-tab-pane\", {\n attrs: {\n label: _vm.$t(\"message.wfInstance\"),\n name: \"WORKFLOW\"\n }\n })], 1), _c(\"el-row\", [_c(\"el-table\", {\n staticStyle: {\n width: \"100%\"\n },\n attrs: {\n data: _vm.instancePageResult.data,\n \"row-class-name\": _vm.instanceTableRowClassName\n }\n }, [_c(\"el-table-column\", {\n attrs: {\n \"show-overflow-tooltip\": true,\n prop: \"jobId\",\n label: _vm.$t(\"message.jobId\"),\n width: \"80\"\n }\n }), _c(\"el-table-column\", {\n attrs: {\n \"show-overflow-tooltip\": true,\n prop: \"jobName\",\n label: _vm.$t(\"message.jobName\")\n }\n }), _vm.instanceQueryContent.type === \"WORKFLOW\" ? _c(\"el-table-column\", {\n attrs: {\n \"show-overflow-tooltip\": true,\n prop: \"wfInstanceId\",\n label: _vm.$t(\"message.wfInstanceId\"),\n width: \"155\"\n }\n }) : _vm._e(), _c(\"el-table-column\", {\n attrs: {\n \"show-overflow-tooltip\": true,\n prop: \"instanceId\",\n label: _vm.$t(\"message.instanceId\")\n }\n }), _c(\"el-table-column\", {\n attrs: {\n prop: \"status\",\n label: _vm.$t(\"message.status\"),\n width: \"160\"\n },\n scopedSlots: _vm._u([{\n key: \"default\",\n fn: function (scope) {\n return [_vm._v(_vm._s(_vm.fetchStatus(scope.row.status)))];\n }\n }])\n }), _c(\"el-table-column\", {\n attrs: {\n prop: \"actualTriggerTime\",\n label: _vm.$t(\"message.triggerTime\"),\n width: \"150\"\n }\n }), _c(\"el-table-column\", {\n attrs: {\n prop: \"finishedTime\",\n label: _vm.$t(\"message.finishedTime\"),\n width: \"150\"\n }\n }), _c(\"el-table-column\", {\n attrs: {\n label: _vm.$t(\"message.operation\"),\n width: \"285\"\n },\n scopedSlots: _vm._u([{\n key: \"default\",\n fn: function (scope) {\n return [_c(\"el-button\", {\n attrs: {\n size: \"mini\",\n type: \"primary\"\n },\n on: {\n click: function ($event) {\n return _vm.onClickShowDetail(scope.row);\n }\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.detail\")))]), _c(\"el-button\", {\n attrs: {\n size: \"mini\",\n type: \"success\"\n },\n on: {\n click: function ($event) {\n return _vm.onClickShowLog(scope.row);\n }\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.log\")))]), _c(\"el-button\", {\n attrs: {\n size: \"mini\",\n type: \"warning\"\n },\n on: {\n click: function ($event) {\n return _vm.onClickRetryJob(scope.row);\n }\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.reRun\")))]), _c(\"el-button\", {\n attrs: {\n size: \"mini\",\n type: \"danger\"\n },\n on: {\n click: function ($event) {\n return _vm.onClickStop(scope.row);\n }\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.stop\")))])];\n }\n }])\n })], 1)], 1), _c(\"el-row\", [_c(\"el-col\", {\n attrs: {\n span: 24\n }\n }, [_c(\"el-pagination\", {\n attrs: {\n total: this.instancePageResult.totalItems,\n \"page-size\": this.instancePageResult.pageSize,\n layout: \"prev, pager, next\"\n },\n on: {\n \"current-change\": _vm.onClickChangeInstancePage\n }\n })], 1)], 1), _vm.instanceDetailVisible ? _c(\"el-dialog\", {\n attrs: {\n visible: _vm.instanceDetailVisible,\n width: \"80%\"\n },\n on: {\n \"update:visible\": function ($event) {\n _vm.instanceDetailVisible = $event;\n }\n }\n }, [_c(\"div\", {\n staticClass: \"power-instance-detail-log\"\n }, [_c(\"InstanceDetail\", {\n attrs: {\n \"instance-id\": _vm.currentInstanceId,\n resultAll: true\n }\n })], 1)]) : _vm._e(), _c(\"el-dialog\", {\n attrs: {\n visible: _vm.instanceLogVisible,\n width: \"80%\"\n },\n on: {\n \"update:visible\": function ($event) {\n _vm.instanceLogVisible = $event;\n }\n }\n }, [_c(\"el-row\", [_c(\"el-col\", {\n staticClass: \"power-instance-log-download\",\n staticStyle: {\n \"margin-bottom\": \"20px\"\n },\n attrs: {\n span: 24\n }\n }, [_c(\"el-button\", {\n attrs: {\n type: \"primary\",\n size: \"mini\",\n icon: \"el-icon-download\"\n },\n on: {\n click: function ($event) {\n return _vm.onclickDownloadLog();\n }\n }\n }, [_vm._v(_vm._s(_vm.$t(\"message.download\")))])], 1)], 1), _c(\"div\", {\n staticClass: \"power-instance-log-dialog\"\n }, [_c(\"el-row\", [_c(\"el-col\", {\n attrs: {\n span: 24\n }\n }, [_c(\"h4\", {\n staticStyle: {\n \"white-space\": \"pre-line\"\n }\n }, [_vm._v(_vm._s(this.paginableInstanceLog.data))])])], 1)], 1), _c(\"el-row\", [_c(\"el-col\", {\n attrs: {\n span: 24\n }\n }, [_c(\"el-pagination\", {\n attrs: {\n \"page-count\": _vm.paginableInstanceLog.totalPages,\n layout: \"prev, pager, next\"\n },\n on: {\n \"current-change\": _vm.onClickChangeLogPage\n }\n })], 1)], 1)], 1)], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./src/components/views/InstanceManager.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%2277823dab-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options");
|