{"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/Library/MacroLibs.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/Library/MacroLibs.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 \"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\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { saveMacroLibs, editgetMacroLibs, saveEditMacroLibs } from \"@/service/LibraryAPI.js\";\nimport ScriptEditorSelect from \"@/components/Common/scriptEditor\";\nimport { nameCheck } from \"@/utils/utils.js\";\nexport default {\n name: \"getMacroLibs\",\n components: {\n ScriptEditorSelect: ScriptEditorSelect\n },\n data: function data() {\n return {\n formData: {\n name: \"\",\n content: \"\",\n description: \"\"\n },\n id: \"\",\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 content: [{\n required: true,\n message: this.$t('placeholder.script'),\n trigger: 'blur'\n }]\n },\n scriptEditorVisible: false,\n // 脚本编辑器弹窗\n btnLoading: false // 按钮加载的图标\n\n };\n },\n mounted: function mounted() {\n var edit = this.$route.query.edit;\n\n if (edit && edit != 'false') {\n this.getMacroLibs();\n }\n },\n methods: {\n /**\n * 保存表单\n */\n save: function save(formName) {\n var _this = this;\n\n this.$refs[formName].validate( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(valid) {\n var appId, macroId, response, _response;\n\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 = 20;\n break;\n }\n\n appId = sessionStorage.getItem(\"appId\");\n macroId = _this.$route.query.macroId || _this.formData.id;\n\n if (!macroId) {\n _context.next = 12;\n break;\n }\n\n _this.btnLoading = true;\n _context.next = 7;\n return saveEditMacroLibs(appId, macroId, _this.formData);\n\n case 7:\n response = _context.sent;\n _this.btnLoading = false;\n\n if (response.data.errcode == 0) {\n _this.$message.success(_this.$t('msg.ss'));\n }\n\n _context.next = 18;\n break;\n\n case 12:\n // 新建\n _this.btnLoading = true;\n _context.next = 15;\n return saveMacroLibs(appId, _this.formData);\n\n case 15:\n _response = _context.sent;\n _this.btnLoading = false;\n\n if (_response.data.errcode == 0) {\n _this.$message.success(_this.$t('msg.ss'));\n\n _this.formData.id = _response.data.data.id;\n }\n\n case 18:\n _context.next = 22;\n break;\n\n case 20:\n console.log('error submit!!');\n return _context.abrupt(\"return\", false);\n\n case 22:\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 },\n\n /**\n * 获取函数库详情\n */\n getMacroLibs: function () {\n var _getMacroLibs = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var appId, macroId, response;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n appId = sessionStorage.getItem(\"appId\");\n macroId = this.$route.query.macroId;\n _context2.next = 4;\n return editgetMacroLibs(appId, macroId);\n\n case 4:\n response = _context2.sent;\n\n if (response.data.errcode == 0) {\n this.formData = response.data.data;\n }\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function getMacroLibs() {\n return _getMacroLibs.apply(this, arguments);\n }\n\n return getMacroLibs;\n }(),\n\n /**\n * 退出\n */\n close: function close() {\n this.$store.dispatch(\"rightHelpPageParams\", {\n title: this.$t('msg.function_list'),\n url: \"application/application_info_libraries_macroLibs_list_help.html\"\n });\n this.$router.push({\n path: '/home/softwaresdetails/Library/MacroLibsList',\n query: {\n edit: true\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.formData.content = val;\n }\n },\n computed: {\n /**\n * textarea 传给 脚本编辑器的值\n */\n showScritptEditorCode: function showScritptEditorCode() {\n return this.formData.content;\n }\n },\n watch: {\n \"$store.state.rightHelpPageParams\": {\n handler: function handler() {\n if (this.$store.state.rightHelpFrame) {\n this.$store.state.rightHelpFrame.contentWindow.showHelpContentHtml(this.$store.state.rightHelpPageParams.title, this.$store.state.rightHelpPageParams.url);\n }\n },\n deep: true\n }\n }\n};",null]}