{"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/Modules/Reports.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/Modules/Reports.vue","mtime":1701674859501},{"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 \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.replace\";\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\";\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\";\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//\nimport { getContextPath } from \"@/service/ModulesApi.js\";\nimport { getModuleViewList } from \"@/service/ViewApi.js\";\nimport { getModuleFormList } from \"@/service/FormApi.js\";\nimport { getQueryColumnInfos, updateReport, previewReport, createReports, getReportDetail } from \"@/service/ReportApi.js\";\nimport ChooseDomain from \"@/components/Modules/ChooseDomain.vue\";\nimport DataSourceList from \"@/components/AdvancedTool/DataSourceList.vue\";\nimport ScriptEditorSelect from \"@/components/Common/scriptEditor\";\nimport { nameCheck, descCheck } from \"@/utils/utils.js\";\nexport default {\n name: 'reports',\n components: {\n ChooseDomain: ChooseDomain,\n DataSourceList: DataSourceList,\n ScriptEditorSelect: ScriptEditorSelect\n },\n data: function data() {\n return {\n data: [],\n activeName: 'basic',\n params: {\n appId: \"\",\n moduleId: \"\",\n id: \"\",\n //报表id\n uri: \"\",\n isPrint: 0,\n name: \"\",\n //报表名称\n description: \"\",\n //描述\n scriptTemplate: \"\",\n //模板脚本\n xmlTemplate: \"\",\n //模板xml\n dataSourceType: \"DATASOURCE_TYPE_VIEW\",\n //数据源类型\n dataSourceSearchForm: \"\",\n //数据源查询表单\n dataSourceView: null,\n dataSourceSqlConnectDs: null,\n dataSourceSqlScript: \"\",\n //数据源sql脚本\n dataSourceCustomScript: \"\",\n //自定义数据源脚本\n jrxmlFilePath: \"\",\n //jrxml文件路径地址\n dataSourceName: \"\",\n //数据源名称\n isDefaultStyle: \"\",\n //默认样例\n reportColumnInfos: null,\n jrxmlString: null,\n viewId: \"\",\n //关联视图id\n domainId: null,\n reportExampleName: \"\",\n //样例名称\n procedureScript: \"\",\n //存储过程数据源脚本\n reportSql: null,\n subReportId: \"\",\n formId: \"\",\n templateType: \"JRXML\",\n //模板类型\n drdataSource: null\n },\n relatedforms: [],\n //相关表单\n viewData: [],\n //数据视图\n formData: [],\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 dataSourceName: [{\n required: true,\n message: this.$t('msg.select_dbSource'),\n trigger: 'blur'\n }],\n // dataSourceSearchForm: [\n // { required: true, message: '请选择数据源查询表单', trigger: 'change' },\n // ],\n dataSourceSqlScript: [{\n required: true,\n message: this.$t('msg.write_sql'),\n trigger: 'blur'\n }],\n viewId: [{\n required: true,\n message: this.$t('msg.select_dataview'),\n trigger: 'blur'\n }],\n description: [{\n validator: descCheck,\n trigger: \"blur\"\n }],\n dataSourceCustomScript: [{\n required: true,\n message: this.$t('msg.write_datasource'),\n trigger: 'blur'\n }]\n },\n isPrintVisible: false,\n //是否作为打印模板\n viewVisible: true,\n //视图数据源\n sqlVisible: false,\n //SQL数据源\n procedureVisible: false,\n //存储过程数据源\n customVisible: false,\n //自定义数据源\n tableHeight: 400,\n outerVisible: false,\n innerVisible: false,\n multipleSelectionId: [],\n multipleSelectionArray: [],\n jndiVisible: false,\n iframeHeight: 400,\n contextPath: getContextPath(),\n src: \"./reportHtml/reportHtmlTem.html?contextPath=\".concat(getContextPath()),\n domainVisible: false,\n datasourceType: 'dialog',\n scriptEditorVisible: false,\n // 脚本编辑器弹窗\n currentScriptEditor: \"\",\n // 当前选中的脚本编辑器\n spanClick: 'handleSpanClick',\n iframeStyle: '',\n //iframe全屏样式\n iframeHeightBefore: 100,\n test: '222',\n basicRef: '',\n loading: true,\n btnLoading: false // 按钮的加载图标\n\n };\n },\n mounted: function () {\n var _mounted = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _this = this;\n\n var appId, moduleId, result, data, params, mapFrame;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n appId = sessionStorage.getItem(\"appId\");\n moduleId = this.$route.query.moduleId;\n\n if (!this.$route.query.edit) {\n _context.next = 12;\n break;\n }\n\n _context.next = 5;\n return getReportDetail(this.$route.query.reportId);\n\n case 5:\n result = _context.sent;\n data = result.data.data;\n\n if (data.isPrint == 0) {\n this.onDataSourceType(data.dataSourceType);\n } else {\n this.onDataSourceType(data.isPrint);\n }\n\n this.params = _objectSpread(_objectSpread({}, data), {}, {\n appId: appId,\n moduleId: moduleId,\n parentId: moduleId\n });\n this.src += \"&subReportId=\".concat(this.params.subReportId, \"&moduleId=\").concat(this.params.moduleId, \"&applicationid=\").concat(this.params.appId, \"&reportId=\").concat(this.params.id, \"&dateSourceType=\").concat(this.params.dataSourceType);\n _context.next = 14;\n break;\n\n case 12:\n params = _objectSpread(_objectSpread({}, this.params), {}, {\n appId: appId,\n moduleId: moduleId,\n parentId: moduleId\n });\n this.params = params;\n\n case 14:\n this.getScollerHeight();\n this.getRelatedFromList();\n this.getViewList();\n this.getFromList();\n mapFrame = this.$refs.reportDetail;\n\n if (mapFrame.attachEvent) {\n // 兼容浏览器判断\n mapFrame.attachEvent('onload', function () {\n var iframeWin = mapFrame.contentWindow;\n iframeWin.postMessage(_this.params, '*'); // data传递的参数 *写成子页面的域名或者是ip\n });\n } else {\n mapFrame.onload = function () {\n var iframeWin = mapFrame.contentWindow;\n iframeWin.postMessage(_this.params, '*');\n };\n }\n\n this.basicRef = this.$refs.params;\n\n case 21:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function mounted() {\n return _mounted.apply(this, arguments);\n }\n\n return mounted;\n }(),\n created: function created() {\n var _this2 = this;\n\n //操作iframe的全屏事件\n window[this.spanClick] = function (isScresn) {\n _this2.allScrean(isScresn);\n };\n },\n methods: {\n //vue中的全屏按钮点击事件\n openAllScren: function openAllScren() {\n this.$refs.reportDetail.contentWindow.document.getElementById(\"handleTest\").click();\n },\n //全屏事件\n allScrean: function allScrean(isScresn) {\n var _this3 = this;\n\n if (isScresn) {\n this.iframeStyle = 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:10';\n this.iframeHeight = '100%';\n var timer = setTimeout(function () {\n _this3.$refs[\"reportDetail\"].contentWindow.caclcuHeight(true);\n\n clearTimeout(timer);\n }, 100);\n } else {\n this.iframeStyle = '';\n this.iframeHeight = this.iframeHeightBefore;\n\n var _timer = setTimeout(function () {\n _this3.$refs[\"reportDetail\"].contentWindow.caclcuHeight(false);\n\n clearTimeout(_timer);\n }, 100);\n }\n },\n //关闭数据源弹窗\n closeDatasource: function closeDatasource() {\n this.outerVisible = false;\n },\n checkDomainOk: function () {\n var _checkDomainOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(checkDomainId) {\n var response;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(checkDomainId != \"\")) {\n _context2.next = 5;\n break;\n }\n\n _context2.next = 3;\n return previewReport({\n reportId: this.params.id,\n checkDomainId: checkDomainId\n });\n\n case 3:\n response = _context2.sent;\n\n if (response.data.errcode == 0) {\n window.open(this.contextPath.replace(/\\/api/, \"\") + response.data.data);\n } else {\n this.$message({\n message: response.data && response.data.errmsg ? \"\\u9884\\u89C8\\u5931\\u8D25!\\u9519\\u8BEF\\u4FE1\\u606F\\uFF1A\".concat(response.data.errmsg) : '预览失败!',\n type: 'error'\n });\n }\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function checkDomainOk(_x) {\n return _checkDomainOk.apply(this, arguments);\n }\n\n return checkDomainOk;\n }(),\n preview: function () {\n var _preview = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n var response;\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n if (!(this.params.dataSourceType == 'DATASOURCE_TYPE_VIEW')) {\n _context3.next = 4;\n break;\n }\n\n this.domainVisible = true;\n _context3.next = 8;\n break;\n\n case 4:\n _context3.next = 6;\n return previewReport({\n reportId: this.params.id\n });\n\n case 6:\n response = _context3.sent;\n\n if (response.data.errcode == 0) {\n window.open(this.contextPath.replace(/\\/api/, \"\") + response.data.data);\n } else {\n this.$message({\n message: response.data && response.data.errmsg ? \"\\u9884\\u89C8\\u5931\\u8D25!\\u9519\\u8BEF\\u4FE1\\u606F\\uFF1A\".concat(response.data.errmsg) : '预览失败!',\n type: 'error'\n });\n }\n\n case 8:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function preview() {\n return _preview.apply(this, arguments);\n }\n\n return preview;\n }(),\n\n /**\n * 查看源代码\n */\n showCode: function showCode() {\n this.$refs.reportDetail.contentWindow.document.getElementById(\"showCode\").click();\n },\n\n /**\n * 动态计算页面table高度\n */\n getScollerHeight: function getScollerHeight() {\n var _this4 = this;\n\n setTimeout(function () {\n var clientHeight = document.documentElement.clientHeight || document.body.clientHeight; //60 头部, 32 面包屑, 41 第一层页签, 40 第二层页签, 50 列表标题, 71 查询, 20 父组件外边距, 40分页\n\n _this4.tableHeight = clientHeight - 60 - 32 - 41 - 50 - 20;\n _this4.iframeHeight = clientHeight - 60 - 32 - 41 - 50 - 8; // 8: 删除画布内容会错位\n\n _this4.iframeHeightBefore = clientHeight - 60 - 32 - 41 - 50 - 8; // 8: 删除画布内容会错位\n\n console.log('iframeHeight', _this4.iframeHeight);\n }, 100);\n },\n\n /**\n * 获取视图列表\n */\n getViewList: function getViewList() {\n var _this5 = this;\n\n var params = this.params;\n var searchParams = {\n appId: params.appId,\n moduleId: params.moduleId,\n searchword: \"\",\n pageNo: 1,\n linesPerPage: 10000\n };\n getModuleViewList(searchParams, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this5.viewData = response.data.data.datas;\n }\n }\n });\n },\n\n /**\n * 获取数据源查询表单\n */\n getFromList: function getFromList() {\n var _this6 = this;\n\n this.loading = true;\n var searchParams = {\n appId: sessionStorage.getItem('appId'),\n moduleId: this.$route.query.moduleId,\n name: \"\",\n description: '',\n type: \"256\",\n pageNo: 1,\n linesPerPage: 10000\n };\n getModuleFormList(searchParams, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this6.loading = false;\n _this6.formData = response.data.data ? response.data.data : []; // 遍历看是否存在该值\n // if(this.formData && this.formData.length > 0){\n\n var have = false;\n\n _this6.formData.some(function (item) {\n if (item.id == _this6.params.dataSourceSearchForm) {\n have = true;\n }\n });\n\n if (!have) {\n _this6.params.dataSourceSearchForm = \"\";\n } // }\n\n }\n }\n });\n },\n\n /**\n * 获取相关表单\n */\n getRelatedFromList: function getRelatedFromList() {\n var _this7 = this;\n\n var params = this.params;\n var searchParams = {\n appId: params.appId,\n moduleId: params.moduleId,\n name: \"\",\n description: \"\",\n type: \"1\",\n pageNo: 1,\n linesPerPage: 10000\n };\n getModuleFormList(searchParams, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this7.relatedforms = response.data.data;\n }\n }\n });\n },\n\n /**\n * 切换页签\n */\n handleClick: function handleClick(activeName) {\n var _this8 = this;\n\n var id = this.params.id;\n\n if (id == \"\" && activeName == \"content\") {\n this.$message({\n type: 'info',\n message: this.$t('msg.write_info_save')\n });\n return false;\n } else if (id != \"\" && activeName == 'content') {\n var params = {\n appId: sessionStorage.getItem('appId'),\n reportId: id,\n dataSourceName: this.params.dataSourceName,\n type: this.params.dataSourceType,\n isForm: this.params.viewId ? false : true,\n viewId: this.params.viewId ? this.params.viewId : this.params.formId\n }; // 判断是哪一种模式就传哪种值\n\n if (this.params.dataSourceType == 'DATASOURCE_TYPE_VIEW') {\n params.data = {\n scriptString: \"\"\n };\n } else if (this.params.dataSourceType == 'DATASOURCE_TYPE_SQL') {\n params.data = {\n scriptString: this.params.dataSourceSqlScript ? this.params.dataSourceSqlScript : ''\n };\n } else if (this.params.dataSourceType == 'DATASOURCE_TYPE_PROCEDURE') {\n params.data = {\n scriptString: this.params.procedureScript ? this.params.procedureScript : ''\n };\n } else if (this.params.dataSourceType == 'DATASOURCE_TYPE_CUSTOM') {\n params.data = {\n scriptString: this.params.dataSourceCustomScript ? this.params.dataSourceCustomScript : ''\n };\n }\n\n getQueryColumnInfos(params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n var data = _objectSpread({}, _this8.params);\n\n data.fields = response.data.data;\n\n _this8.$refs.reportDetail.contentWindow.postMessage(data, '*');\n }\n }\n }); // window.frames['reportDetail'].reportDat=params;\n }\n },\n\n /**\n * 退出\n */\n goback: function goback() {\n this.$store.dispatch(\"rightHelpPageParams\", {\n title: this.$t('msg.print_list'),\n url: \"application/application_module_print_list_help.html\"\n });\n this.$router.push({\n path: '/home/softwaresdetails/reportslist',\n query: {\n edit: true,\n moduleId: this.$route.query.moduleId\n }\n });\n },\n\n /**\n * 切换是否作为打印模板\n */\n onPrintChange: function onPrintChange(val) {\n if (val == 1) {\n this.isPrintVisible = true;\n this.viewVisible = false;\n } else {\n this.isPrintVisible = false;\n this.viewVisible = true;\n }\n },\n\n /**\n * 切换数据源\n */\n onDataSourceType: function onDataSourceType(val) {\n var isPrintVisible = false;\n var viewVisible = false;\n var sqlVisible = false;\n var procedureVisible = false;\n var customVisible = false;\n\n switch (val) {\n case 1:\n isPrintVisible = true;\n break;\n\n case \"DATASOURCE_TYPE_VIEW\":\n viewVisible = true;\n break;\n\n case \"DATASOURCE_TYPE_SQL\":\n sqlVisible = true;\n break;\n\n case \"DATASOURCE_TYPE_PROCEDURE\":\n procedureVisible = true;\n break;\n\n case \"DATASOURCE_TYPE_CUSTOM\":\n customVisible = true;\n break;\n }\n\n this.isPrintVisible = isPrintVisible;\n this.viewVisible = viewVisible;\n this.sqlVisible = sqlVisible;\n this.procedureVisible = procedureVisible;\n this.customVisible = customVisible;\n },\n saveBasic: function saveBasic(type, formName) {\n var _this9 = this;\n\n var params = _objectSpread(_objectSpread(_objectSpread({}, this.params), this.$refs.reportDetail.contentWindow.params), {}, {\n name: this.params.name\n });\n\n if (params.result == 'chartNoData') {\n this.$message({\n message: this.$t('msg.point_data'),\n type: 'error'\n });\n return false;\n } else if (params.result == 'haveNoChunkElement') {\n this.$message({\n message: this.$t('msg.replace'),\n type: 'error'\n });\n return false;\n } else if (params.result == 'haveGroupNoName') {\n this.$message({\n message: this.$t('msg.set_name'),\n type: 'error'\n });\n return false;\n } else if (params.result && type == 'content') {\n if (!params.parentId) params.parentId = params.moduleId;\n\n if (params.name) {\n this.basicRef.validate( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(valid) {\n var response;\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!valid) {\n _context4.next = 5;\n break;\n }\n\n _context4.next = 3;\n return updateReport(params);\n\n case 3:\n response = _context4.sent;\n\n if (response.data.errcode == 0) {\n _this9.$message.success(_this9.$t('msg.update_ss'));\n }\n\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n return function (_x2) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n } else if (type == 'basic') {\n if (params.name) {\n this.$refs[formName].validate( /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(valid) {\n var response;\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n if (!valid) {\n _context5.next = 5;\n break;\n }\n\n _context5.next = 3;\n return updateReport(params);\n\n case 3:\n response = _context5.sent;\n\n if (response.data.errcode == 0) {\n _this9.$message.success(_this9.$t('msg.update_ss'));\n }\n\n case 5:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n\n return function (_x3) {\n return _ref2.apply(this, arguments);\n };\n }());\n }\n }\n },\n\n /**\n * 保存报表\n */\n saveReports: function saveReports(params) {\n var _this10 = this;\n\n if (this.params.id) {\n if (this.activeName == \"basic\") {\n this.$refs.reportDetail.contentWindow.document.getElementById(\"save_btn\").click();\n this.saveBasic('basic', params);\n } else if (this.activeName == \"content\") {\n this.$refs.reportDetail.contentWindow.document.getElementById(\"save_btn\").click();\n this.saveBasic('content', params);\n }\n } else {\n this.$refs[params].validate( /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(valid) {\n var response, _params;\n\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n if (!valid) {\n _context6.next = 7;\n break;\n }\n\n _context6.next = 3;\n return createReports(_this10.params);\n\n case 3:\n response = _context6.sent;\n\n if (response.data.errcode == 0) {\n _params = _objectSpread(_objectSpread({}, _this10.params), {}, {\n id: response.data.data.id,\n jrxmlFilePath: response.data.data.jrxmlFilePath\n });\n _this10.params = _params;\n\n _this10.$message({\n message: _this10.$t('msg.created_ss'),\n type: 'success'\n });\n\n _this10.$refs.reportDetail.contentWindow.postMessage(_this10.params, '*');\n }\n\n _context6.next = 8;\n break;\n\n case 7:\n return _context6.abrupt(\"return\", false);\n\n case 8:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n\n return function (_x4) {\n return _ref3.apply(this, arguments);\n };\n }());\n }\n },\n\n /**\n * 打开数据源列表对话框\n */\n openDataSourceDialog: function openDataSourceDialog() {\n this.outerVisible = true;\n },\n\n /**\n * 选中数据源回显\n */\n onRowClick: function onRowClick(row) {\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n dataSourceName: row.name\n });\n\n this.params = params;\n this.outerVisible = false;\n },\n\n /**\n * 数据源SQL 测试\n */\n testDataSource: function testDataSource() {\n var _this11 = this;\n\n var params = {\n appId: sessionStorage.getItem('appId'),\n dataSourceName: this.params.dataSourceName,\n type: this.params.dataSourceType,\n viewId: this.params.viewId\n };\n params.data = {\n scriptString: this.params.dataSourceSqlScript ? this.params.dataSourceSqlScript : ''\n };\n getQueryColumnInfos(params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this11.$message.success(_this11.$t('msg.test_ss'));\n } else {\n _this11.$message.error(_this11.$t('msg.test_err'));\n }\n }\n });\n },\n\n /**\n * 显示脚本编辑器弹框\n */\n showScriptEditor: function showScriptEditor(val) {\n this.scriptEditorVisible = true;\n this.currentScriptEditor = val;\n },\n\n /**\n * 将脚本编辑器的值写入到textarea中\n */\n handleScriptEditor: function handleScriptEditor(val) {\n if (this.currentScriptEditor === \"dataSourceSqlScript\") {\n // 数据源SQL\n this.params.dataSourceSqlScript = val;\n } else if (this.currentScriptEditor === \"procedureScript\") {\n // 存储过程数据源\n this.params.procedureScript = val;\n } else if (this.currentScriptEditor === \"dataSourceCustomScript\") {\n // 自定义数据源\n this.params.dataSourceCustomScript = val;\n }\n }\n },\n computed: {\n /**\n * 脚本编辑器的值\n */\n showScritptEditorCode: function showScritptEditorCode() {\n var code;\n\n if (this.currentScriptEditor === \"dataSourceSqlScript\") {\n // 数据源SQL\n code = this.params.dataSourceSqlScript;\n } else if (this.currentScriptEditor === \"procedureScript\") {\n // 存储过程数据源\n code = this.params.procedureScript;\n } else if (this.currentScriptEditor === \"dataSourceCustomScript\") {\n // 自定义数据源\n code = this.params.dataSourceCustomScript;\n }\n\n return code;\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]}