{"remainingRequest":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/CommonTool/Task.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/CommonTool/Task.vue","mtime":1701674859500},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/thread-loader/dist/cjs.js","mtime":1701674873947},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js","mtime":1701674874357},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js","mtime":1701674874903}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"regenerator-runtime/runtime\";\nimport _asyncToGenerator from \"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/@babel/runtime-corejs2/helpers/esm/asyncToGenerator\";\nimport \"core-js/modules/es6.number.constructor\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { createTasks, updateTasks, startTask as _startTask, stopTask as _stopTask } from \"@/service/CommontoolsAPI.js\";\nimport { getSuperuser as _getSuperuser } from \"@/service/CommonApi.js\";\nimport { TimeToDate, nameCheck } from \"@/utils/utils.js\";\nimport ScriptEditorSelect from \"@/components/Common/scriptEditor\";\nexport default {\n name: 'task',\n components: {\n ScriptEditorSelect: ScriptEditorSelect\n },\n data: function data() {\n return {\n user: {},\n params: {\n appId: \"\",\n id: \"\",\n name: \"\",\n //任务名称\n creatorid: \"\",\n //创建人id\n creator: \"\",\n //创建人\n type: \"1\",\n //类型\n startupType: \"0\",\n //启动类型\n period: \"0\",\n //周期\n interval: '1',\n modifyTime: \"\",\n //修改时间\n description: \"\",\n //描述\n terminateScript: \"\",\n //终止脚本\n taskScript: \"\",\n //任务脚本\n rDate: \"\",\n //运行时间\n rTime: \"\",\n //时间\n daysOfWeek: [],\n //运行一周,周日、周一...\n dayOfMonth: 1 //运行日期,1~31 \n\n },\n rules: {\n name: [{\n required: true,\n message: this.$t('placeholder.name'),\n trigger: 'blur'\n }, {\n validator: nameCheck,\n trigger: \"blur\"\n }],\n rDate: [{\n required: true,\n message: this.$t('placeholder.select_date'),\n trigger: 'change'\n }],\n rTime: [{\n required: true,\n message: this.$t('placeholder.select_time'),\n trigger: 'change'\n }]\n },\n defaultVislble: true,\n //默认,不重复\n theDayVislble: false,\n //立刻、分钟、小时\n everyDayVisible: false,\n //每日\n weeklyVisible: false,\n //每周\n perMonthVisible: false,\n //每月\n start: false,\n tableHeight: 400,\n scriptEditorVisible: false,\n // 脚本编辑器弹窗\n btnLoading: false // 请求资源是按钮loading\n\n };\n },\n mounted: function mounted() {\n //获取特权用户\n this.getSuperuser(); //获取当前时间\n\n this.initDate();\n\n if (this.$route.query.edit == true || this.$route.query.edit == 'true') {\n var record = this.$route.query.params;\n var defaultVislble = false;\n var theDayVislble = false;\n var everyDayVisible = false;\n var weeklyVisible = false;\n var perMonthVisible = false;\n\n switch (record.period) {\n case 0:\n defaultVislble = true;\n break;\n\n case 8192:\n theDayVislble = true;\n break;\n\n case 34:\n theDayVislble = true;\n break;\n\n case 546:\n theDayVislble = true;\n break;\n\n case 2:\n everyDayVisible = true;\n break;\n\n case 32:\n weeklyVisible = true;\n break;\n\n case 512:\n perMonthVisible = true;\n break;\n }\n\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n appId: record.appId,\n id: record.id,\n name: record.name,\n //任务名称\n creatorid: record.creatorid,\n //创建人id\n creator: record.creator,\n //创建人\n type: String(record.type),\n //类型\n startupType: String(record.startupType),\n //启动类型\n period: String(record.period),\n //周期\n interval: String(record.interval),\n modifyTime: record.modifyTime,\n //修改时间\n description: record.description,\n //描述\n terminateScript: record.terminateScript,\n //终止脚本\n taskScript: record.taskScript,\n //任务脚本\n rDate: record.rDate,\n //运行时间\n rTime: record.rTime,\n //时间\n daysOfWeek: record.daysOfWeek ? record.daysOfWeek : [],\n dayOfMonth: record.dayOfMonth ? record.dayOfMonth : 1\n });\n\n this.params = params;\n this.defaultVislble = defaultVislble;\n this.theDayVislble = theDayVislble;\n this.everyDayVisible = everyDayVisible;\n this.weeklyVisible = weeklyVisible;\n this.perMonthVisible = perMonthVisible;\n } else {\n var appId = sessionStorage.getItem(\"appId\");\n\n var _params = _objectSpread(_objectSpread({}, this.params), {}, {\n appId: appId\n });\n\n this.params = _params;\n }\n\n this.getScollerHeight();\n },\n methods: {\n /**\n * 动态计算页面table高度\n */\n getScollerHeight: function getScollerHeight() {\n var _this = this;\n\n setTimeout(function () {\n var clientHeight = document.documentElement.clientHeight || document.body.clientHeight; //60 头部, 32 面包屑, 41 第一层页签, 40 第二层页签, 50 列表标题, 71 查询, 20 父组件外边距, 40分页\n\n _this.tableHeight = clientHeight - 60 - 32 - 41 - 40 - 50 - 20;\n }, 100);\n },\n\n /**\n * **获取特权用户信息**\n */\n getSuperuser: function getSuperuser() {\n var _this2 = this;\n\n _getSuperuser({\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this2.user = response.data.data;\n _this2.params.creatorid = response.data.data.id;\n _this2.params.creator = response.data.data.name;\n }\n }\n });\n },\n\n /**\n * 获取当前时间\n */\n initDate: function initDate() {\n var time = new Date();\n var date = TimeToDate(time, \"YYYY-MM-DD h:m:s\");\n this.params.modifyTime = date;\n },\n //修改interval\n checkInterval: function checkInterval() {\n if (this.params.period == '34') {\n if (this.params.interval > 60 || this.params.interval < 0) {\n alert('应该输入0-60的合理数据');\n this.params.interval = 1;\n }\n } else {\n if (this.params.interval < 0 || this.params.interval > 3600) {\n alert('应该输入0-3600的合理数据');\n this.params.interval = 1;\n }\n }\n },\n\n /**\n * 退出\n */\n goback: function goback() {\n this.$router.push({\n path: '/home/softwaresdetails/commontool/tasklist',\n query: {\n edit: true\n }\n });\n },\n\n /**\n * 切换重复-时间\n */\n onTimeChange: function onTimeChange(e) {\n var defaultVislble = false;\n var theDayVislble = false;\n var everyDayVisible = false;\n var weeklyVisible = false;\n var perMonthVisible = false;\n\n switch (Number(e)) {\n case 0:\n defaultVislble = true;\n break;\n\n case 8192:\n theDayVislble = true;\n break;\n\n case 34:\n theDayVislble = true;\n break;\n\n case 546:\n theDayVislble = true;\n break;\n\n case 2:\n everyDayVisible = true;\n break;\n\n case 32:\n weeklyVisible = true;\n break;\n\n case 512:\n perMonthVisible = true;\n break;\n }\n\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n period: e\n });\n\n this.params = params;\n this.defaultVislble = defaultVislble;\n this.theDayVislble = theDayVislble;\n this.everyDayVisible = everyDayVisible;\n this.weeklyVisible = weeklyVisible;\n this.perMonthVisible = perMonthVisible;\n },\n\n /**\n * 保存操作\n */\n btnSave: function btnSave(formName, type) {\n var _this3 = this;\n\n this.initDate();\n\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n type: Number(this.params.type),\n startupType: Number(this.params.startupType),\n period: Number(this.params.period),\n interval: Number(this.params.interval) && (this.params.period == '34' || this.params.period == '546') ? Number(this.params.interval) : 1,\n dayOfMonth: Number(this.params.dayOfMonth)\n });\n\n if (this.params.id != \"\") {\n this.$refs[formName].validate( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(valid) {\n var response;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!valid) {\n _context.next = 9;\n break;\n }\n\n //更新\n _this3.btnLoading = true;\n _context.next = 4;\n return updateTasks(params);\n\n case 4:\n response = _context.sent;\n _this3.btnLoading = false;\n\n if (response.data.errcode == 0) {\n _this3.$message.success(_this3.$t('msg.ss'));\n\n if (type == 'save_new') {\n _this3.resetFields();\n }\n }\n\n _context.next = 10;\n break;\n\n case 9:\n return _context.abrupt(\"return\", false);\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n } else {\n this.$refs[formName].validate( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(valid) {\n var response, data;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!valid) {\n _context2.next = 9;\n break;\n }\n\n //创建\n _this3.btnLoading = true;\n _context2.next = 4;\n return createTasks(params);\n\n case 4:\n response = _context2.sent;\n _this3.btnLoading = false;\n\n if (response.data.errcode == 0) {\n data = _objectSpread(_objectSpread({}, _this3.params), {}, {\n id: response.data.data.id\n });\n _this3.params = data;\n\n _this3.$message.success(_this3.$t('msg.ss'));\n\n if (type == 'save_new') {\n _this3.resetFields();\n }\n }\n\n _context2.next = 10;\n break;\n\n case 9:\n return _context2.abrupt(\"return\", false);\n\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }());\n }\n },\n\n /**\n * 保存并新建\n */\n btnSaveNew: function btnSaveNew(params) {\n this.btnSave(params, 'save_new');\n },\n\n /**\n * 重置内容\n */\n resetFields: function resetFields() {\n this.params = {\n appId: sessionStorage.getItem(\"appId\"),\n id: \"\",\n name: \"\",\n //任务名称\n creatorid: \"\",\n //创建人id\n creator: \"\",\n //创建人\n type: \"1\",\n //类型\n startupType: \"0\",\n //启动类型\n period: \"0\",\n //周期\n interval: '1',\n modifyTime: \"\",\n //修改时间\n description: \"\",\n //描述\n terminateScript: \"\",\n //终止脚本\n taskScript: \"\",\n //任务脚本\n rDate: \"\",\n //运行时间\n rTime: \"\",\n //时间\n daysOfWeek: [],\n //运行一周,周日、周一...\n dayOfMonth: 1 //运行日期,1~31 \n\n }; // 清空校验\n\n this.$refs['params'].resetFields();\n },\n\n /**\n * 开始任务\n */\n startTask: function startTask() {\n var _this4 = this;\n\n _startTask(this.params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this4.$message({\n message: response.data.data.msg,\n type: 'success'\n });\n\n _this4.start = true;\n }\n }\n });\n },\n\n /**\n * 停止任务\n */\n stopTask: function stopTask() {\n var _this5 = this;\n\n _stopTask(this.params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this5.$message({\n message: response.data.data.msg,\n type: 'success'\n });\n\n _this5.start = false;\n }\n }\n });\n },\n\n /**\n * 显示脚本编辑器弹框\n */\n showScriptEditor: function showScriptEditor() {\n this.scriptEditorVisible = true;\n },\n\n /**\n * 将脚本编辑器的值写入到textarea中\n */\n handleScriptEditor: function handleScriptEditor(val) {\n this.params.taskScript = val;\n }\n },\n computed: {\n /**\n * textarea 传给 脚本编辑器的值\n */\n showScritptEditorCode: function showScritptEditorCode() {\n return this.params.taskScript;\n }\n }\n};",null]}