{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\generator\\sysModulePreview.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\generator\\sysModulePreview.vue","mtime":1667327529512},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\babel.config.js","mtime":1667327525434},{"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\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"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":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.function.name\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { Base64 } from 'js-base64';\nimport req from '@/request.js';\nexport default {\n name: 'sysModulePreview',\n props: ['id', 'dialogVisible', 'appName'],\n data: function data() {\n return {\n asideShow: true,\n workspaceList: [],\n datalistList: [],\n viewlistList: [],\n isShowIframe: true,\n loading: false,\n chartId: '',\n iframeSrc: '',\n menuData: {},\n chartList: [],\n menuTypeList: [{\n type: 'workspaceList',\n name: '工作空间'\n }, {\n type: 'datalistList',\n name: '数据列表'\n }, {\n type: 'viewlistList',\n name: '视图列表'\n }, {\n type: 'chartList',\n name: '图表列表'\n }, {\n type: 'otherList',\n name: '栏目列表'\n }],\n otherList: []\n };\n },\n watch: {\n id: function id(newVal, oldVal) {\n var _this = this;\n\n if (!newVal) {\n return;\n }\n\n this.init();\n var url = window.context.portal + '/sys/sysModule/v1/getJson?id=' + this.id;\n req.get(url).then(function (response) {\n _this.initDetails(response.data);\n\n var menuData = [];\n\n _this.initMenuData(menuData);\n\n _this.menuData = menuData;\n }, true);\n }\n },\n created: function created() {\n var _this2 = this;\n\n var id = this.id;\n\n if (!this.dialogVisible) {\n id = this.$route.params.id;\n }\n\n if (!id) {\n return;\n }\n\n this.init();\n var url = window.context.portal + '/sys/sysModule/v1/getJson?id=' + id;\n req.get(url).then(function (response) {\n _this2.initDetails(response.data);\n\n var menuData = [];\n\n _this2.initMenuData(menuData);\n\n _this2.menuData = menuData;\n });\n },\n methods: {\n testLoad: function testLoad() {\n this.loading = false;\n },\n init: function init() {\n this.workspaceList = [];\n this.datalistList = [];\n this.viewlistList = [];\n this.iframeSrc = '';\n this.menuData = {};\n this.chartList = [];\n this.menuTypeList = [{\n type: 'workspaceList',\n name: '工作空间'\n }, {\n type: 'datalistList',\n name: '数据列表'\n }, {\n type: 'viewlistList',\n name: '视图列表'\n }, {\n type: 'chartList',\n name: '图表列表'\n }, {\n type: 'otherList',\n name: '栏目列表'\n }];\n this.otherList = [];\n },\n initDetails: function initDetails(data) {\n if (data.moduleDetail && data.moduleDetail.length > 0) {\n for (var i = 0; i < data.moduleDetail.length; i++) {\n var type = data.moduleDetail[i].type;\n\n switch (type) {\n case 'workspace':\n this.workspaceList.push(data.moduleDetail[i]);\n break;\n\n case 'datalist':\n this.datalistList.push(data.moduleDetail[i]);\n break;\n\n case 'viewlist':\n this.viewlistList.push(data.moduleDetail[i]);\n break;\n\n case 'chart':\n this.chartList.push(data.moduleDetail[i]);\n break;\n\n case 'other':\n this.otherList.push(data.moduleDetail[i]);\n break;\n }\n }\n }\n },\n initMenuData: function initMenuData(menuData) {\n for (var k = 0; k < this.menuTypeList.length; k++) {\n var type = this.menuTypeList[k].type;\n\n if (this[type].length > 0) {\n var typeList = this[type];\n\n if (type == 'otherList') {\n var map = {};\n\n for (var i = 0; i < typeList.length; i++) {\n if (!map[typeList[i].columnName]) {\n map[typeList[i].columnName] = typeList[i].columnName;\n var item = {\n text: typeList[i].columnName,\n children: []\n };\n\n for (var n = 0; n < typeList.length; n++) {\n if (typeList[i].columnName == typeList[n].columnName) {\n var sub = {\n text: typeList[n].name,\n code: typeList[n].code,\n type: type,\n url: typeList[n].url\n };\n item.children.push(sub);\n }\n }\n\n menuData.push(item);\n }\n }\n } else {\n var item = {\n text: this.menuTypeList[k].name,\n children: []\n };\n\n for (var i = 0; i < typeList.length; i++) {\n var sub = {\n text: typeList[i].name,\n code: typeList[i].code,\n type: type,\n url: typeList[i].url\n };\n item.children.push(sub);\n }\n\n menuData.push(item);\n }\n }\n }\n\n if (menuData.length > 0) {\n var _item = menuData[0].children[0];\n this.iframeSrc = this.getUrl(_item.url, _item.type);\n }\n },\n handleSelect: function handleSelect(index) {\n var _this3 = this;\n\n var path = index.split('_');\n\n if (path.length > 1) {\n var item = this.menuData[path[0]].children[path[1]];\n\n if (item.type == 'chartList') {\n this.isShowIframe = false;\n this.chartId = item.url;\n } else {\n this.isShowIframe = false;\n setTimeout(function () {\n _this3.iframeSrc = _this3.getUrl(item.url, item.type);\n });\n }\n }\n },\n getUrl: function getUrl(url, type) {\n this.loading = true;\n this.isShowIframe = true;\n var iframeSrc = url;\n\n switch (type) {\n case 'workspaceList':\n iframeSrc = window.context.front + url + '?token=' + this.$store.state.login.currentUser.token;\n break;\n\n case 'datalistList':\n iframeSrc = window.context.front + \"/sysModulePreview\" + url + \"/true\" + '?token=' + this.$store.state.login.currentUser.token;\n break;\n\n case 'viewlist':\n break;\n\n case 'chartList':\n this.isShowIframe = false;\n this.loading = false;\n this.chartId = url;\n break;\n }\n\n return iframeSrc;\n }\n },\n destroyed: function destroyed() {}\n};",null]}