{"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/WidgetList.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/WidgetList.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 \"core-js/modules/es6.string.fontcolor\";\nimport \"core-js/modules/es6.regexp.split\";\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.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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { getWidgets as _getWidgets, deleteWidgets, getViewsModuleList, saveWidgets, updateWidgets, getLogoUrl as _getLogoUrl } from \"@/service/CommontoolsAPI.js\";\nimport { getAllmodules } from \"@/service/CommonApi.js\";\nimport { getChartsList } from \"@/service/ModulesApi.js\";\nimport { getSummarysListData } from \"@/service/FormApi.js\";\nimport { getReportsList } from \"@/service/ReportApi.js\";\nimport publicTable from \"@/components/Common/publicTable.vue\";\nimport icon_select from \"@/components/Common/icon_select.vue\";\nimport font_select from \"@/components/Common/font_select.vue\";\nimport ColorPicker from \"@/components/Common/ColorPicker\";\nimport fileUpload from \"@/components/Common/fileUpload\";\nimport { nameCheck } from \"@/utils/utils.js\";\nimport { delMsg } from '@/utils/elementui';\nimport { getRoles as _getRoles } from \"@/service/CommontoolsAPI.js\";\nimport ScriptEditorSelect from \"@/components/Common/scriptEditor\";\nimport config from '@/assets/json/config';\nexport default {\n name: 'widgetlist',\n data: function data() {\n return {\n params: {\n appId: \"\",\n id: \"\",\n //widget id\n name: \"\",\n //widget 名称\n type: \"\",\n //类型\n published: \"\",\n //是否发布\n orderno: \"\",\n //排序号\n searchword: \"\",\n //搜索名字\n pageNo: 1,\n linesPerPage: 10\n },\n data: {},\n multipleSelectionId: [],\n multipleSelectionArray: [],\n tableHeight: 100,\n dialogFormVisible: false,\n //对话框\n widgetForm: {\n name: \"\",\n //名称\n type: \"\",\n //类型\n authMode: \"0\",\n //授权方式\n widgetType: \"0\",\n //支持类型\n countType: 'none',\n // 统计类型\n published: \"true\",\n //是否发布\n moduleid: \"\",\n //模块\n actionView: \"\",\n //作用视图\n chart: \"\",\n //图表\n actionContent: \"\",\n //\n actionSummary: \"\",\n //摘要\n actionUrl: \"\",\n //链接地址URL\n iconShow: false,\n //是否常用\n iscript: \"\",\n //Iscript脚本内容\n userScript: \"\",\n // 脚本返回用户对象集合\n width: \"\",\n //宽度\n height: \"\",\n //高度\n authRolesId: \"\",\n //\n authRolesName: \"\",\n //\n icon: \"\",\n //\n titleColor: \"#000\",\n //标题颜色\n titleBColor: null,\n //标题背景颜色\n titleBarColor: null,\n //标题栏颜色\n orderno: \"\",\n //排序号\n frequency: 0,\n //频率\n carouselImg: \"\" //轮播图图片\n\n },\n icon: {\n icontype: \"img\",\n imgUrl: \"/uploads/lib/icon_menu_default.png\",\n fontUrl: \"\",\n iconFontColor: \"rgba(0, 0, 0, 1)\"\n },\n iconSelectCheck: false,\n // 图片\n fontSelectCheck: false,\n // 字体图标\n fontStyle: \"\",\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 type: [{\n required: true,\n message: this.$t('placeholder.select_type'),\n trigger: 'blur'\n }],\n orderno: [{\n required: true,\n message: this.$t('placeholder.into_order_num'),\n trigger: 'blur'\n }],\n actionSummary: [{\n required: true,\n message: this.$t('placeholder.choose_summary'),\n trigger: 'blur'\n }],\n customizeReport: [{\n required: true,\n message: this.$t('msg.select_report'),\n trigger: 'blur'\n }],\n actionUrl: [{\n required: true,\n message: this.$t('placeholder.enter_url'),\n trigger: 'blur'\n }],\n iscript: [{\n required: true,\n message: this.$t('placeholder.enter_script'),\n trigger: 'blur'\n }]\n },\n predefineColors: ['#000', '#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#00ced1', '#1e90ff', '#c71585', 'rgba(255, 69, 0, 0.68)', 'rgb(255, 120, 0)', 'hsv(51, 100, 98)', 'hsva(120, 40, 94, 0.5)', 'hsl(181, 100%, 37%)', 'hsla(209, 100%, 56%, 0.73)', '#c7158577'],\n typeOptions: config.widgetOptions,\n isTypeOptions: {\n isActionSummary: false,\n //摘要\n isModule: false,\n //模块\n isActionView: false,\n //作用视图\n isCustomizeReport: false,\n //作用报表\n isChart: false,\n //图表\n isActionUrl: false,\n //链接地址(URL)\n isIsript: false //Iscript脚本内容\n\n },\n moduleOptions: [],\n //模板数组\n actionViewOptions: [],\n //作用视图数组\n reportOptions: [],\n //报表\n tableData: {\n params: [{\n name: 'name',\n label: this.$t('stateLabel.name'),\n value: \"\"\n }]\n },\n roleVisible: false,\n roleParams: {\n appId: \"\",\n name: \"\",\n //角色名称\n pageNo: 1,\n linesPerPage: 10\n },\n tableDataRole: {\n params: [{\n name: 'name',\n label: this.$t('stateLabel.name'),\n value: \"\"\n }],\n tableHeight: '350px'\n },\n checkedRoles: [],\n scriptEditorVisible: false,\n // 脚本编辑器弹窗\n currentScriptEditor: '',\n // 当前选中哪一个脚本编辑器\n fileUploadVisible: false,\n // 图片上传弹窗\n btnLoading: false // 按钮的加载\n\n };\n },\n components: {\n publicTable: publicTable,\n icon_select: icon_select,\n font_select: font_select,\n ColorPicker: ColorPicker,\n ScriptEditorSelect: ScriptEditorSelect,\n fileUpload: fileUpload\n },\n mounted: function mounted() {\n this.getScollerHeight();\n\n if (this.$route.query.edit) {\n var appId = sessionStorage.getItem(\"appId\");\n\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n appId: appId\n });\n\n this.params = params;\n this.roleParams.appId = appId;\n this.getWidgets();\n }\n },\n methods: {\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 switch (this.currentScriptEditor) {\n case \"iscript\":\n this.widgetForm.iscript = val;\n break;\n\n case \"userScript\":\n this.widgetForm.userScript = val;\n break;\n\n default:\n break;\n }\n },\n //退出编辑widget\n exitEditDetail: function exitEditDetail() {\n this.dialogFormVisible = false;\n this.checkedRoles = [];\n },\n //退出选择角色弹窗\n onRoleExit: function onRoleExit() {\n this.roleVisible = false;\n },\n //角色选中确认\n onRoleConfirm: function onRoleConfirm() {\n debugger;\n var authRolesNames = [];\n var authRolesIds = [];\n this.checkedRoles.map(function (e) {\n authRolesNames.push(e.name);\n authRolesIds.push(e.id);\n });\n this.widgetForm.authRolesName = authRolesNames.join(\";\");\n this.widgetForm.authRolesId = authRolesIds.join(\";\");\n this.roleVisible = false;\n },\n //清除所选角色\n onRoleClean: function onRoleClean() {\n this.$refs.publictable_role.clearSelection();\n this.checkedRoles = [];\n this.tableDataRole.checkedRows = this.checkedRoles;\n this.widgetForm.authRolesName = '';\n this.widgetForm.authRolesId = '';\n },\n //清除详情中的角色字段\n onRoleClean_detail: function onRoleClean_detail() {\n this.checkedRoles = [];\n this.tableDataRole.checkedRows = this.checkedRoles;\n this.widgetForm.authRolesName = '';\n this.widgetForm.authRolesId = '';\n },\n //角色列表页码变化\n roleCurrPageChange: function roleCurrPageChange(val) {\n var roleParams = _objectSpread(_objectSpread({}, this.roleParams), {}, {\n pageNo: val\n });\n\n this.roleParams = roleParams;\n this.getRoles();\n },\n //角色列表页大小变化\n rolePageSizeChange: function rolePageSizeChange(val) {\n var roleParams = _objectSpread(_objectSpread({}, this.roleParams), {}, {\n linesPerPage: val\n });\n\n this.roleParams = roleParams;\n this.getRoles();\n },\n\n /**\n * 勾选行时响应\n */\n handleRoleSelectionChange: function handleRoleSelectionChange(val) {\n var _this = this;\n\n this.checkedRoles = [];\n\n if (val.length) {\n val.map(function (e) {\n _this.checkedRoles.push(e);\n });\n }\n\n this.tableDataRole.checkedRows = this.checkedRoles;\n },\n //更新参数\n updataRoleParams: function updataRoleParams(obj) {\n Object.assign(this.roleParams, obj);\n },\n //获取角色列表\n getRoles: function () {\n var _getRoles2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {\n var _this2 = this;\n\n var response, data, tempArr, i, j;\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return _getRoles(this.roleParams);\n\n case 2:\n response = _context.sent;\n\n if (!(response.data.errcode == 0)) {\n _context.next = 24;\n break;\n }\n\n data = response.data.data; // 进行数据回选\n\n if (!(this.widgetForm.authRolesId != \"\")) {\n _context.next = 20;\n break;\n }\n\n tempArr = this.widgetForm.authRolesId.split(';').filter(function (item) {\n return item != \"\";\n });\n i = 0;\n\n case 8:\n if (!(i < tempArr.length)) {\n _context.next = 20;\n break;\n }\n\n j = 0;\n\n case 10:\n if (!(j < data.datas.length)) {\n _context.next = 17;\n break;\n }\n\n if (!(data.datas[j].id == tempArr[i])) {\n _context.next = 14;\n break;\n }\n\n this.checkedRoles.push(data.datas[j]);\n return _context.abrupt(\"break\", 17);\n\n case 14:\n j++;\n _context.next = 10;\n break;\n\n case 17:\n i++;\n _context.next = 8;\n break;\n\n case 20:\n this.tableDataRole.columns = [{\n prop: 'name',\n label: this.$t('roles.name')\n }];\n this.tableDataRole.data = data;\n this.tableDataRole.checkedRows = this.checkedRoles;\n this.$nextTick(function () {\n _this2.$refs.publictable_role.init(_this2.tableDataRole);\n });\n\n case 24:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getRoles() {\n return _getRoles2.apply(this, arguments);\n }\n\n return getRoles;\n }(),\n //选择角色\n chooseRole: function chooseRole() {\n this.roleVisible = true;\n this.getRoles();\n },\n //更新参数\n updataParams: function updataParams(obj) {\n Object.assign(this.params, obj);\n },\n\n /**\n * 动态计算页面table高度\n */\n getScollerHeight: function getScollerHeight() {\n var _this3 = this;\n\n setTimeout(function () {\n var clientHeight = document.documentElement.clientHeight || document.body.clientHeight; //60 头部, 32 面包屑, 41 第一层页签, 40 第二层页签, 50 列表标题, 71 查询, 20 父组件外边距, 40分页\n\n _this3.tableData.tableHeight = clientHeight - 60 - 32 - 41 - 40 - 50 - 71 - 20 - 40 + 'px';\n\n _this3.$nextTick(function () {\n _this3.$refs.publictable.init(_this3.tableData);\n });\n }, 100);\n },\n\n /**\n * 获取widget列表\n */\n getWidgets: function () {\n var _getWidgets2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {\n var _this4 = this;\n\n var response, data, i;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return _getWidgets(this.params);\n\n case 2:\n response = _context2.sent;\n\n if (response.data.errcode == 0) {\n data = response.data.data;\n\n for (i = 0; i < data.datas.length; i++) {\n if (data.datas[i].type == \"summary\") {\n data.datas[i].label = this.$t('widget.summary');\n } else if (data.datas[i].type == \"view\") {\n data.datas[i].label = this.$t('view.view');\n } else if (data.datas[i].type == \"page\") {\n data.datas[i].label = this.$t('widget.ual_content');\n } else if (data.datas[i].type == \"customizeReport\") {\n data.datas[i].label = this.$t('menu.custom_report');\n } else if (data.datas[i].type == \"chart\") {\n data.datas[i].label = this.$t('widget.chart');\n } else if (data.datas[i].type == \"system_workflow\") {\n data.datas[i].label = this.$t('form.flow_processing');\n } else if (data.datas[i].type == \"iscript\") {\n data.datas[i].label = this.$t('widget.cal_script');\n } else if (data.datas[i].type == \"carboncopy\") {\n data.datas[i].label = this.$t('widget.carboncopy');\n } else if (data.datas[i].type == \"carousel\") {\n data.datas[i].label = this.$t('widget.carousel');\n } else if (data.datas[i].type == \"checkin\") {\n data.datas[i].label = '签到';\n }\n\n if (data.datas[i].published == true) {\n data.datas[i].publishShow = this.$t('widget.yes');\n } else if (data.datas[i].published == false) {\n data.datas[i].publishShow = this.$t('widget.no');\n }\n }\n\n this.tableData.columns = [{\n prop: 'name',\n label: this.$t('widget.name')\n }, {\n prop: 'label',\n label: this.$t('widget.type')\n }, {\n prop: 'publishShow',\n label: this.$t('widget.publish_or_not')\n }, {\n prop: 'orderno',\n label: this.$t('widget.order_number')\n }];\n this.tableData.data = data;\n console.log(data);\n this.$nextTick(function () {\n _this4.$refs.publictable.init(_this4.tableData);\n });\n }\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function getWidgets() {\n return _getWidgets2.apply(this, arguments);\n }\n\n return getWidgets;\n }(),\n\n /**\n * 重置查询名称值\n */\n resetName: function resetName() {\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n name: \"\"\n });\n\n this.params = params;\n this.getWidgets();\n },\n\n /**\n * 勾选行时响应\n */\n handleSelectionChange: function handleSelectionChange(val) {\n var multipleSelectionId = [];\n\n if (val.length) {\n val.map(function (e) {\n multipleSelectionId.push(e.id);\n });\n }\n\n this.multipleSelectionArray = val;\n this.multipleSelectionId = multipleSelectionId;\n },\n\n /**\n * 新建widget\n */\n createRoles: function createRoles() {\n this.dialogFormVisible = true;\n var widgetForm = {\n id: \"\",\n //id\n name: \"\",\n //名称\n type: \"\",\n //类型\n authMode: \"0\",\n //授权方式\n widgetType: \"0\",\n //支持类型\n countType: 'none',\n // 统计类型\n published: \"true\",\n //是否发布\n moduleid: \"\",\n //模块\n actionView: \"\",\n //作用视图\n chart: \"\",\n //图表\n icontype: \"font\",\n //图标类型\n actionContent: \"\",\n //\n actionSummary: \"\",\n //摘要\n actionUrl: \"\",\n //链接地址URL\n iconShow: false,\n //是否常用\n iscript: \"\",\n //Iscript脚本内容\n width: \"\",\n //宽度\n height: \"\",\n //高度\n authRolesId: \"\",\n //\n authRolesName: \"\",\n //\n icon: \"\",\n //\n titleColor: \"#000\",\n //标题颜色\n titleBColor: null,\n //标题背景颜色\n titleBarColor: null,\n //标题栏颜色\n orderno: \"\",\n //排序号\n frequency: 0,\n //频率\n carouselImg: \"\",\n //轮播图图片\n imgUrl: \"/uploads/lib/icon_menu_default.png\",\n fontUrl: \"\",\n iconFontColor: \"rgba(0, 0, 0, 1)\"\n }; // 重置显示的属性\n\n var isTypeOptions = {\n isActionSummary: false,\n //摘要\n isModule: false,\n //模块\n isActionView: false,\n //作用视图\n isCustomizeReport: false,\n //作用报表\n isChart: false,\n //图表\n isActionUrl: false,\n //链接地址(URL)\n isIsript: false //Iscript脚本内容\n\n };\n this.widgetForm = widgetForm;\n this.isTypeOptions = isTypeOptions; // 重置所有的错误消息\n // let params = {\n // appId: sessionStorage.getItem(\"appId\"),\n // }\n // this.$router.push({path: '/home/softwaresdetails/commontool/roles', query:{edit: false, params: params}});\n },\n\n /**\n * 删除widget\n */\n showDeleteConfirm: function () {\n var _showDeleteConfirm = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {\n var params, multipleSelectionId, response;\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n params = this.params;\n multipleSelectionId = this.multipleSelectionId;\n\n if (!(multipleSelectionId.length > 0)) {\n _context3.next = 17;\n break;\n }\n\n _context3.prev = 3;\n _context3.next = 6;\n return delMsg(this.$t('msg.delConfirm'), this.$t('msg.tip'));\n\n case 6:\n _context3.next = 8;\n return deleteWidgets(multipleSelectionId, params.appId);\n\n case 8:\n response = _context3.sent;\n\n if (response.data.errcode == 0) {\n this.getWidgets();\n this.$message.success(this.$t('msg.del_ss'));\n }\n\n _context3.next = 15;\n break;\n\n case 12:\n _context3.prev = 12;\n _context3.t0 = _context3[\"catch\"](3);\n console.log(_context3.t0);\n\n case 15:\n _context3.next = 18;\n break;\n\n case 17:\n this.$message.error(this.$t('msg.check_data'));\n\n case 18:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this, [[3, 12]]);\n }));\n\n function showDeleteConfirm() {\n return _showDeleteConfirm.apply(this, arguments);\n }\n\n return showDeleteConfirm;\n }(),\n\n /**\n * 选中数据源回显\n */\n onRowClick: function onRowClick(row) {\n var _this5 = this;\n\n this.icon = JSON.parse(row.icon); // 设置字体图标颜色\n\n if (this.icon.iconFontColor && this.icon.icontype == 'font') {\n this.$nextTick(function () {\n _this5.fontStyle = 'color:' + _this5.icon.iconFontColor;\n _this5.$refs.fontcolor.color = _this5.icon.iconFontColor;\n });\n } // 同步数据\n\n\n this.widgetForm = _objectSpread(_objectSpread({}, row), {}, {\n authMode: row.authMode + \"\",\n //授权方式\n widgetType: row.widgetType + \"\",\n //支持方式\n published: row.published == true ? \"true\" : \"false\",\n //是否发布\n icontype: JSON.parse(row.icon).icontype\n });\n this.typeChange(row.type, row);\n this.dialogFormVisible = true; // this.$router.push({path: '/home/softwaresdetails/commontool/roles', query:{edit: true, params: params}});\n },\n\n /**\n * 当前页\n */\n handleCurrentChange: function handleCurrentChange(val) {\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n pageNo: val\n });\n\n this.params = params;\n this.getWidgets();\n },\n\n /**\n * 切换分页,每页显示多少条\n */\n handleSizeChange: function handleSizeChange(val) {\n var params = _objectSpread(_objectSpread({}, this.params), {}, {\n linesPerPage: val\n });\n\n this.params = params;\n this.getWidgets();\n },\n\n /**\n * 选择类型\n */\n typeChange: function () {\n var _typeChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(val, row) {\n var _this6 = this;\n\n var isActionSummary, isModule, isActionView, isCustomizeReport, isChart, isActionUrl, isIsript, appId, currentModuleId, response, resp, _response, _response2, isTypeOptions;\n\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n isActionSummary = false; //摘要\n\n isModule = false; //模块\n\n isActionView = false; //作用视图\n\n isCustomizeReport = false; //作用报表\n\n isChart = false; //图表\n\n isActionUrl = false; //链接地址(URL)\n\n isIsript = false; //Iscript脚本内容\n\n appId = sessionStorage.getItem(\"appId\");\n currentModuleId = \"\";\n this.widgetForm.moduleid = '';\n this.actionViewOptions = [];\n _context5.t0 = val;\n _context5.next = _context5.t0 === \"summary\" ? 14 : _context5.t0 === \"view\" ? 17 : _context5.t0 === \"page\" ? 24 : _context5.t0 === \"customizeReport\" ? 27 : _context5.t0 === \"chart\" ? 42 : _context5.t0 === \"iscript\" ? 57 : 60;\n break;\n\n case 14:\n //摘要\n isActionSummary = true;\n getSummarysListData({\n appId: appId,\n id: ''\n }, {\n onSucess: function () {\n var _onSucess = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(response) {\n var summaryArr;\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (response.data.errcode == 0) {\n summaryArr = response.data.data.data;\n summaryArr.map(function (item) {\n if (item.scope == 0) {\n item.showName = item.name + _this6.$t('widget.todo_summary');\n } else if (item.scope == 1) {\n item.showName = item.name + _this6.$t('widget.flow_share');\n } else if (item.scope == 6) {\n item.showName = item.name + _this6.$t('widget.flow_carboncopy');\n }\n });\n _this6.actionViewOptions = summaryArr; // 需要拼接数据才可以\n\n _this6.$set(_this6.widgetForm, 'actionSummary', row.actionContent);\n }\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n function onSucess(_x3) {\n return _onSucess.apply(this, arguments);\n }\n\n return onSucess;\n }()\n });\n return _context5.abrupt(\"break\", 61);\n\n case 17:\n //视图\n isModule = true;\n isActionView = true;\n _context5.next = 21;\n return getAllmodules(appId, currentModuleId);\n\n case 21:\n response = _context5.sent;\n\n if (response.data.errcode == 0) {\n this.moduleOptions = response.data.data;\n\n if (row) {\n this.widgetForm.moduleid = row.moduleid; // this.params.linesPerPage = 100;\n\n getViewsModuleList(row.moduleid, this.params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this6.actionViewOptions = response.data.data.datas.filter(function (item) {\n return item.type == 1 || item.type == 16;\n }); // 判断有当前id就选中,没有就清空数组\n\n var flag = false;\n\n for (var i = 0; i < _this6.actionViewOptions.length; i++) {\n if (_this6.actionViewOptions[i].id == row.actionContent) {\n flag = true;\n\n _this6.$set(_this6.widgetForm, 'actionView', row.actionContent);\n\n break;\n }\n }\n\n if (!flag) {\n _this6.$set(_this6.widgetForm, 'actionView', \"\");\n }\n }\n }\n });\n }\n }\n\n return _context5.abrupt(\"break\", 61);\n\n case 24:\n //链接内容\n isActionUrl = true;\n\n if (row) {\n // this.widgetForm.actionUrl = row.actionContent\n this.$set(this.widgetForm, 'actionUrl', row.actionContent);\n }\n\n return _context5.abrupt(\"break\", 61);\n\n case 27:\n //自定义报表\n isModule = true;\n isCustomizeReport = true;\n _context5.next = 31;\n return getAllmodules(appId, currentModuleId);\n\n case 31:\n resp = _context5.sent;\n\n if (!(resp.data.errcode == 0)) {\n _context5.next = 41;\n break;\n }\n\n this.moduleOptions = resp.data.data;\n\n if (!row) {\n _context5.next = 41;\n break;\n }\n\n this.widgetForm.moduleid = row.moduleid;\n this.params.moduleId = row.moduleid; // this.params.linesPerPage = 100;\n\n _context5.next = 39;\n return getReportsList(this.params);\n\n case 39:\n _response = _context5.sent;\n\n if (_response.data.errcode == 0) {\n this.actionViewOptions = _response.data.data.datas;\n this.$set(this.widgetForm, 'customizeReport', row.actionContent);\n }\n\n case 41:\n return _context5.abrupt(\"break\", 61);\n\n case 42:\n //图表\n isModule = true;\n isChart = true;\n _context5.next = 46;\n return getAllmodules(appId, currentModuleId);\n\n case 46:\n resp = _context5.sent;\n\n if (!(resp.data.errcode == 0)) {\n _context5.next = 56;\n break;\n }\n\n this.moduleOptions = resp.data.data;\n\n if (!row) {\n _context5.next = 56;\n break;\n }\n\n this.widgetForm.moduleid = row.moduleid;\n this.params.moduleId = row.moduleid; // this.params.linesPerPage = 100;\n\n _context5.next = 54;\n return getChartsList(this.params);\n\n case 54:\n _response2 = _context5.sent;\n\n if (_response2.data.errcode == 0) {\n this.actionViewOptions = _response2.data.data.data; // this.widgetForm.chart = row.actionContent\n\n this.$set(this.widgetForm, 'chart', row.actionContent);\n }\n\n case 56:\n return _context5.abrupt(\"break\", 61);\n\n case 57:\n //计算脚本值\n isIsript = true;\n\n if (row) {\n // this.widgetForm.iscript = row.actionContent\n this.$set(this.widgetForm, 'iscript', row.actionContent);\n }\n\n return _context5.abrupt(\"break\", 61);\n\n case 60:\n return _context5.abrupt(\"break\", 61);\n\n case 61:\n isTypeOptions = _objectSpread(_objectSpread({}, isTypeOptions), {}, {\n isActionSummary: isActionSummary,\n //摘要\n isModule: isModule,\n //模块\n isActionView: isActionView,\n //作用视图\n isCustomizeReport: isCustomizeReport,\n //作用报表\n isChart: isChart,\n //图表\n isActionUrl: isActionUrl,\n //链接地址(URL)\n isIsript: isIsript //Iscript脚本内容\n\n });\n this.isTypeOptions = isTypeOptions;\n\n case 63:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n function typeChange(_x, _x2) {\n return _typeChange.apply(this, arguments);\n }\n\n return typeChange;\n }(),\n\n /**\n * 获取模块列表--->根据上一级获取\n */\n moduleChange: function () {\n var _moduleChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(val) {\n var _this7 = this;\n\n var response, _response3;\n\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n this.params.moduleId = val;\n this.params.linesPerPage = 100000;\n\n if (!(this.widgetForm.type == \"customizeReport\")) {\n _context6.next = 9;\n break;\n }\n\n _context6.next = 5;\n return getReportsList(this.params);\n\n case 5:\n response = _context6.sent;\n\n if (response.data.errcode == 0) {\n this.actionViewOptions = response.data.data.datas;\n }\n\n _context6.next = 17;\n break;\n\n case 9:\n if (!(this.widgetForm.type == \"chart\")) {\n _context6.next = 16;\n break;\n }\n\n _context6.next = 12;\n return getChartsList(this.params);\n\n case 12:\n _response3 = _context6.sent;\n\n if (_response3.data.errcode == 0) {\n this.actionViewOptions = _response3.data.data.data;\n }\n\n _context6.next = 17;\n break;\n\n case 16:\n getViewsModuleList(val, this.params, {\n onSucess: function onSucess(response) {\n if (response.data.errcode == 0) {\n _this7.actionViewOptions = response.data.data.datas;\n\n _this7.$set(_this7.widgetForm, 'actionView', \"\");\n }\n }\n });\n\n case 17:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n }));\n\n function moduleChange(_x4) {\n return _moduleChange.apply(this, arguments);\n }\n\n return moduleChange;\n }(),\n\n /**\n * 新建保存widget\n */\n save: function save(widgetForm) {\n var _this8 = this;\n\n this.$refs[widgetForm].validate( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(valid) {\n var appId, data, response, _response4;\n\n return regeneratorRuntime.wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n if (!valid) {\n _context7.next = 31;\n break;\n }\n\n appId = sessionStorage.getItem(\"appId\");\n data = JSON.parse(JSON.stringify(_this8.widgetForm));\n data.authMode = parseInt(data.authMode);\n data.widgetType = parseInt(data.widgetType);\n data.orderno = parseInt(data.orderno);\n data.published = data.published == \"true\" ? true : false; // 图片或字体图标\n\n if (_this8.icon.icontype == 'img') {\n data.icon = \"{\\\"icon\\\":\\\"\".concat(_this8.icon.imgUrl, \"\\\",\\\"icontype\\\":\\\"\").concat(_this8.icon.icontype, \"\\\", \\\"imgUrl\\\": \\\"\").concat(_this8.icon.imgUrl, \"\\\"}\");\n } else if (_this8.icon.icontype == 'font') {\n data.icon = \"{\\\"icon\\\":\\\"\".concat(_this8.icon.fontUrl, \"\\\",\\\"icontype\\\":\\\"\").concat(_this8.icon.icontype, \"\\\", \\\"fontUrl\\\":\\\"\").concat(_this8.icon.fontUrl, \"\\\", \\\"iconFontColor\\\":\\\"\").concat(_this8.icon.iconFontColor, \"\\\"}\");\n } // 校验授权给特定角色\n\n\n if (!(_this8.widgetForm.authMode == 1 && _this8.widgetForm.authRolesId == \"\")) {\n _context7.next = 11;\n break;\n }\n\n _this8.$message.error(_this8.$t('widget.select_role'));\n\n return _context7.abrupt(\"return\", false);\n\n case 11:\n if (_this8.isTypeOptions.isActionView) {\n data.actionContent = data.actionView;\n } else if (_this8.isTypeOptions.isChart) {\n data.actionContent = data.chart;\n } else if (_this8.isTypeOptions.isIsript) {\n data.actionContent = data.iscript;\n } else if (_this8.isTypeOptions.isActionUrl) {\n data.actionContent = data.actionUrl;\n } else if (_this8.isTypeOptions.isActionSummary) {\n data.actionContent = data.actionSummary;\n } else if (_this8.isTypeOptions.isCustomizeReport) {\n data.actionContent = data.customizeReport;\n } // 更新\n\n\n if (!data.id) {\n _context7.next = 23;\n break;\n }\n\n data.widgetId = data.id;\n data.parentId = sessionStorage.getItem(\"appId\");\n _this8.btnLoading = true;\n _context7.next = 18;\n return updateWidgets(data);\n\n case 18:\n response = _context7.sent;\n _this8.btnLoading = false;\n\n if (response.data.errcode == 0) {\n _this8.$message.success(_this8.$t('msg.update_ss'));\n\n _this8.dialogFormVisible = false;\n\n _this8.getWidgets();\n }\n\n _context7.next = 29;\n break;\n\n case 23:\n // 新建\n _this8.btnLoading = true;\n _context7.next = 26;\n return saveWidgets(appId, data);\n\n case 26:\n _response4 = _context7.sent;\n _this8.btnLoading = false;\n\n if (_response4.data.errcode == 0) {\n _this8.actionViewOptions = _response4.data.data.datas;\n\n _this8.$message.success(_this8.$t('msg.created_ss'));\n\n _this8.dialogFormVisible = false;\n\n _this8.getWidgets();\n }\n\n case 29:\n _context7.next = 32;\n break;\n\n case 31:\n return _context7.abrupt(\"return\", false);\n\n case 32:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7);\n }));\n\n return function (_x5) {\n return _ref.apply(this, arguments);\n };\n }());\n },\n\n /**\n * 重置弹窗信息\n */\n resetWidgetForm: function resetWidgetForm(formName) {\n var _this9 = this;\n\n this.icon = {\n imgUrl: \"/uploads/lib/icon_menu_default.png\",\n fontUrl: \"\",\n icontype: \"img\",\n iconFontColor: \"rgba(0, 0, 0, 1)\"\n };\n this.$nextTick(function () {\n return _this9.$refs[formName].resetFields();\n });\n },\n getLogoUrl: function getLogoUrl(url) {\n return _getLogoUrl(url);\n },\n onSelectIconOk: function onSelectIconOk(item) {\n if (item) {\n if (item.path) {\n this.widgetForm.icontype = \"img\";\n this.icon.imgUrl = item.path;\n } else {\n this.$message({\n showClose: true,\n type: \"error\",\n message: this.$t('msg.select_fail')\n });\n }\n }\n },\n selectImg: function selectImg() {\n this.iconSelectCheck = true;\n },\n onSelectFontOk: function onSelectFontOk(font) {\n this.icon.fontUrl = font;\n this.icon.icontype = 'font';\n this.fontSelectCheck = false;\n },\n selectFont: function selectFont() {\n this.fontSelectCheck = true;\n },\n\n /**\n * 读取和设置颜色\n */\n setColor: function setColor(val, name) {\n if (name == 'iconFontColor') {\n this.icon.iconFontColor = val; // 设置颜色\n\n this.fontStyle = 'color:' + val;\n } else if (name == 'titleColor') {\n this.widgetForm.titleColor = val;\n } else if (name == 'titleBColor') {\n this.widgetForm.titleBColor = val;\n } else if (name == 'titleBarColor') {\n this.widgetForm.titleBarColor = val;\n }\n },\n onCheckUpload: function onCheckUpload(file) {\n if (file) {\n this.widgetForm.carouselImg = file[0].filePath;\n }\n }\n },\n computed: {\n /**\n * textarea 传给 脚本编辑器的值\n */\n showScritptEditorCode: function showScritptEditorCode() {\n var code;\n\n if (this.currentScriptEditor === 'iscript') {\n // 表单基本是否可编辑脚本\n code = this.widgetForm.iscript;\n } else if (this.currentScriptEditor === 'userScript') {\n // 脚本返回用户对象集合\n code = this.widgetForm.userScript;\n }\n\n return code;\n },\n\n /**\n * 显示 高 标签\n */\n showHeightLabel: function showHeightLabel() {\n var flag = false;\n\n if (this.widgetForm.type == 'chart' || this.widgetForm.type == 'page' || this.widgetForm.type == 'iscript' || this.widgetForm.type == 'carousel') {\n flag = true;\n }\n\n return flag;\n },\n\n /**\n * 显示 频率 标签\n */\n showCarousel: function showCarousel() {\n var flag = false;\n\n if (this.widgetForm.type == 'carousel') {\n flag = true;\n }\n\n return flag;\n }\n }\n};",null]}