{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\portal\\AppCenter.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\portal\\AppCenter.vue","mtime":1675071993022},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.string.ends-with\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.function.name\";\nimport _defineProperty from \"D:/jenkins/workspace/xq-web-bpm/node_modules/@babel/runtime/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//\n//\n//\n//\n//\n//\n//\nimport portal from \"../../api/portal\";\nimport uc from \"@/api/uc.js\";\nimport req from \"@/request.js\";\n\nvar iconDialog = function iconDialog() {\n  return import(\"@/components/dialog/IconDialog.vue\");\n};\n\nvar sysAppMenu = function sysAppMenu() {\n  return import(\"@/components/portal/SysAppMenu.vue\");\n};\n\nvar eipDataTemplateSelector = function eipDataTemplateSelector() {\n  return import(\"@/components/selector/EipDataTemplateSelector.vue\");\n};\n\nvar eipChartSelector = function eipChartSelector() {\n  return import(\"@/components/selector/EipChartSelector.vue\");\n};\n\nvar eipCustomViewSelector = function eipCustomViewSelector() {\n  return import(\"@/components/selector/EipCustomViewSelector.vue\");\n};\n\nvar eipFormSelector = function eipFormSelector() {\n  return import(\"@/components/selector/EipFormSelector.vue\");\n};\n\nvar eipModuleSelector = function eipModuleSelector() {\n  return import(\"@/components/selector/EipModuleSelector.vue\");\n};\n\nvar eipFlowSelector = function eipFlowSelector() {\n  return import(\"@/components/selector/EipFlowSelector.vue\");\n};\n\nvar treeSelect = function treeSelect() {\n  return import(\"@riophae/vue-treeselect\");\n};\n\nvar eipAuthDialog = function eipAuthDialog() {\n  return import(\"@/components/dialog/EipAuthDialog.vue\");\n};\n\nvar portalAppParam = function portalAppParam() {\n  return import(\"@/views/portal/PortalAppParamManager.vue\");\n};\n\nimport \"@riophae/vue-treeselect/dist/vue-treeselect.css\";\nimport { mapState } from \"vuex\";\nexport default {\n  name: \"app-center\",\n  components: {\n    iconDialog: iconDialog,\n    sysAppMenu: sysAppMenu,\n    eipDataTemplateSelector: eipDataTemplateSelector,\n    eipChartSelector: eipChartSelector,\n    eipCustomViewSelector: eipCustomViewSelector,\n    eipFormSelector: eipFormSelector,\n    eipModuleSelector: eipModuleSelector,\n    treeSelect: treeSelect,\n    eipFlowSelector: eipFlowSelector,\n    eipAuthDialog: eipAuthDialog,\n    portalAppParam: portalAppParam\n  },\n  data: function data() {\n    return {\n      apps: [],\n      pageResult: {\n        page: 1,\n        pageSize: 15,\n        total: 0\n      },\n      dialogVisible: false,\n      appModel: {\n        name: \"\",\n        icon: \"\",\n        iconType: 1,\n        iconColor: \"#1339E0\",\n        type: \"\",\n        content: \"\"\n      },\n      typeOptions: [{\n        key: 1,\n        value: '常规应用'\n      }, {\n        key: 2,\n        value: '表单列表'\n      }, {\n        key: 3,\n        value: '自定义视图'\n      }, {\n        key: 4,\n        value: '图表'\n      }, {\n        key: 5,\n        value: \"网页跳转\"\n      }, {\n        key: 6,\n        value: '表单'\n      }, {\n        key: 7,\n        value: '流程模块'\n      }, {\n        key: 8,\n        value: '流程'\n      }],\n      selectId: \"\",\n      activeName: \"base\",\n      deleteUrl: window.context.portal + \"/portal/sysApp/v1/remove\",\n      templateData: {},\n      customQueryData: {},\n      formData: {},\n      moduleData: {},\n      image: \"\",\n      publishDialogVisible: false,\n      menu: {\n        id: \"\",\n        name: \"\"\n      },\n      menus: [],\n      selectedApp: {},\n      flowData: {},\n      searchForm: {\n        appName: \"\",\n        isPublish: false,\n        notPublish: false\n      },\n      selectIdList: [],\n      appTagList: [],\n      tagDialogVisible: false,\n      appTags: [],\n      importDialogVisible: false,\n      uploadUrl: window.context.portal + \"/portal/sysApp/v1/import\",\n      fullscreenLoading: false\n    };\n  },\n  computed: mapState({\n    uploadHeaders: function uploadHeaders(mapState) {\n      return {\n        Authorization: \"Bearer \" + mapState.login.currentUser.token\n      };\n    }\n  }),\n  created: function created() {\n    this.loadData();\n  },\n  methods: {\n    loadData: function loadData(query) {\n      var _this2 = this;\n\n      var loading = this.$loading({\n        target: document.querySelector(\".content\")\n      });\n      var param = {\n        pageBean: this.pageResult,\n        querys: [],\n        sorter: [{\n          direction: 'ASC',\n          property: 'sn_'\n        }]\n      };\n\n      if (query) {\n        param.querys = query;\n      }\n\n      param.sorter = [{\n        property: \"UPDATE_TIME_\",\n        direction: \"DESC\"\n      }];\n      portal.getSysAppList(param).then(function (data) {\n        _this2.apps = data.rows;\n        _this2.pageResult = {\n          page: data.page,\n          pageSize: data.pageSize,\n          total: data.total\n        };\n      }).finally(function () {\n        loading.close();\n      });\n    },\n    loadMenus: function loadMenus() {\n      var _this3 = this;\n\n      portal.getCurrentMenuByAlias(\"app_menu\").then(function (data) {\n        if (data.state) {\n          _this3.menus = data.value;\n\n          if (data.value && data.value.length > 0) {\n            var defaultMenu = data.value.filter(function (item) {\n              return item.alias === 'default';\n            });\n\n            if (defaultMenu && defaultMenu.length != 0) {\n              _this3.menu.id = defaultMenu[0].id;\n            } else {\n              _this3.menu.id = data.value[0].id;\n            }\n          }\n\n          _this3.removeEmptyChildren(_this3.menus);\n        }\n      });\n    },\n    add: function add() {\n      var _this4 = this;\n\n      this.dialogVisible = false;\n      this.$nextTick(function () {\n        _this4.dialogVisible = true;\n      });\n      this.image = \"\";\n      this.appModel = {\n        name: \"\",\n        icon: \"\",\n        iconType: 1,\n        iconColor: \"#1339E0\",\n        type: \"\",\n        content: \"\"\n      };\n    },\n    publish: function publish(app) {\n      this.publishDialogVisible = true;\n      this.loadMenus();\n      this.selectedApp = _objectSpread({}, app);\n    },\n    unPublish: function unPublish(app) {\n      var _this5 = this;\n\n      app.isPublish = 0;\n      portal.publishApp(app).then(function (data) {\n        if (data.state) {\n          _this5.$message({\n            type: 'success',\n            message: data.message\n          });\n\n          _this5.loadData();\n        }\n      });\n    },\n    view: function view(app) {\n      this.publishDialogVisible = true;\n      this.selectedApp = _objectSpread({}, app);\n      this.loadMenus();\n      this.menu.id = this.selectedApp.menuId;\n    },\n    beforeClose: function beforeClose() {\n      this.$set(this, \"templateData\", {});\n      this.dialogVisible = false;\n      this.publishDialogVisible = false;\n      this.tagDialogVisible = false;\n      this.appTags = [];\n    },\n    selectIcon: function selectIcon(icon) {\n      this.image = \"\";\n      this.appModel.icon = icon;\n    },\n    modeChange: function modeChange() {\n      this.$set(this.appModel, \"content\", \"\");\n    },\n    afterSaveData: function afterSaveData() {\n      this.$set(this, \"templateData\", {});\n      this.dialogVisible = false;\n      this.loadData();\n    },\n    beforeSaveData: function beforeSaveData() {\n      if (this.appModel.type === 2) {\n        var data = {\n          id: this.templateData.id,\n          key: this.templateData.alias,\n          name: this.templateData.name\n        };\n        this.appModel.content = JSON.stringify(data);\n      } else if (this.appModel.type === 3) {\n        var _data = {\n          id: this.customQueryData.id,\n          alias: this.customQueryData.alias,\n          sqlAlias: this.customQueryData.sqlAlias,\n          name: this.customQueryData.name\n        };\n        this.appModel.content = JSON.stringify(_data);\n      } else if (this.appModel.type === 6) {\n        var _data2 = {\n          id: this.formData.id,\n          name: this.formData.name,\n          key: this.formData.formKey\n        };\n        this.appModel.content = JSON.stringify(_data2);\n      } else if (this.appModel.type === 7) {\n        var _data3 = {\n          id: this.moduleData.id,\n          name: this.moduleData.name\n        };\n        this.appModel.content = JSON.stringify(_data3);\n      } else if (this.appModel.type === 8) {\n        var _data4 = {\n          id: this.flowData.id,\n          name: this.flowData.name,\n          key: this.flowData.defKey\n        };\n        this.appModel.content = JSON.stringify(_data4);\n      }\n\n      if (this.image) {\n        this.appModel.icon = this.image;\n      }\n    },\n    afterDelete: function afterDelete() {\n      this.loadData();\n    },\n    manage: function manage(id) {\n      var _this6 = this;\n\n      this.dialogVisible = true;\n      this.selectId = id;\n      portal.getSysApp(id).then(function (data) {\n        _this6.appModel = data;\n        _this6.image = \"\";\n\n        if (_this6.appModel.icon && _this6.appModel.icon.indexOf(\"icon\") < 0) {\n          _this6.image = _this6.appModel.icon;\n        }\n\n        if (_this6.appModel.type === 2) _this6.templateData = JSON.parse(_this6.appModel.content);else if (_this6.appModel.type === 3) {\n          _this6.customQueryData = JSON.parse(_this6.appModel.content);\n        } else if (_this6.appModel.type === 6) {\n          _this6.formData = JSON.parse(_this6.appModel.content);\n        } else if (_this6.appModel.type === 8) {\n          _this6.flowData = JSON.parse(_this6.appModel.content);\n        } else if (_this6.appModel.type === 7) {\n          _this6.moduleData = JSON.parse(_this6.appModel.content);\n        }\n      });\n    },\n    confirm: function confirm(id) {\n      var _this7 = this;\n\n      portal.deleteSysApp(id).then(function (data) {\n        if (data.state) {\n          _this7.$message({\n            type: 'success',\n            message: data.message\n          });\n        }\n\n        _this7.loadData();\n\n        _this7.selectIdList = [];\n      });\n    },\n    updateImage: function updateImage(param) {\n      var _this8 = this;\n\n      var formData = new FormData();\n      formData.append(\"files\", param.file);\n      uc.fileUpload(formData).then(function (response) {\n        _this8.$store.dispatch(\"menu/downloadImg\", response.fileId).then(function (res) {\n          if (res != \"\") {\n            _this8.image = res;\n            param.onSuccess();\n          }\n        }).catch(function () {\n          param.onError();\n        });\n      }).catch(function () {\n        param.onError();\n      });\n    },\n    normalizer: function normalizer(node) {\n      return {\n        id: node.id,\n        label: node.name,\n        children: node.children,\n        isDefaultExpanded: false\n      };\n    },\n    removeEmptyChildren: function removeEmptyChildren(menus) {\n      var _this9 = this;\n\n      menus.forEach(function (m) {\n        if (m.children) {\n          if (m.children.length < 1) {\n            delete m.children;\n          } else {\n            _this9.removeEmptyChildren(m.children);\n          }\n        }\n      });\n    },\n    savePublish: function savePublish() {\n      var _this10 = this;\n\n      if (!this.menu.id) {\n        this.$message.warning(\"请选择应用菜单\");\n        return;\n      }\n\n      this.selectedApp.isPublish = 1;\n      this.selectedApp.menuId = this.menu.id;\n      portal.publishApp(this.selectedApp).then(function (data) {\n        if (data.state) {\n          _this10.$message({\n            type: 'success',\n            message: data.message\n          });\n\n          _this10.loadData();\n\n          _this10.publishDialogVisible = false;\n        }\n      });\n    },\n    auth: function auth(app) {\n      var _this = this;\n\n      var id = \"\";\n\n      if (app) {\n        this.selectId = app.id;\n        id = app.id;\n      } else {\n        if (this.selectIdList.length <= 0) {\n          this.$message.warning(\"请选择需要设置的应用\");\n          return;\n        } else {\n          id = this.selectIdList[0];\n          this.selectId = \"\";\n        }\n      }\n\n      portal.getRights(id, \"app\").then(function (resp) {\n        if (resp.data) {\n          var conf = {\n            right: resp.data.right,\n            permissionList: resp.data.type,\n            autoClose: false\n          };\n\n          _this.$refs.appAuth.showDialog(conf);\n        }\n      });\n    },\n    batchSaveRights: function batchSaveRights(data) {\n      var param = {\n        ids: this.selectIdList,\n        objType: \"app\",\n        ownerNameJson: JSON.stringify(data)\n      };\n\n      var _this = this;\n\n      this.$http.post(\"${portal}/sys/authUser/v1/batchSaveRights\", param).then(function (resp) {\n        _this.showResponse(resp);\n      });\n    },\n    saveRight: function saveRight(data) {\n      var param = {\n        id: this.selectId,\n        objType: \"app\",\n        ownerNameJson: JSON.stringify(data)\n      };\n\n      var _this = this;\n\n      this.$http.post(\"${portal}/sys/authUser/v1/saveRights\", param).then(function (resp) {\n        _this.showResponse(resp);\n      });\n    },\n    showResponse: function showResponse(resp) {\n      if (resp.data) {\n        if (resp.data.state) {\n          this.$message.success(\"授权成功\");\n          this.$refs.appAuth.closeDialog();\n        } else {\n          this.$message.error(resp.data.message);\n        }\n      }\n    },\n    authConfirm: function authConfirm(data) {\n      if (this.selectId) {\n        this.saveRight(data);\n      } else {\n        this.batchSaveRights(data);\n      }\n    },\n    currentChange: function currentChange(page) {\n      this.search(page);\n    },\n    search: function search(page) {\n      var query = [];\n\n      if (this.searchForm.appName) {\n        query.push({\n          property: \"name\",\n          operation: \"LIKE\",\n          value: this.searchForm.appName,\n          relation: \"AND\",\n          group: \"a\"\n        });\n      }\n\n      if (this.searchForm.isPublish) {\n        query.push({\n          property: \"isPublish\",\n          operation: \"EQUAL\",\n          value: 1,\n          relation: \"OR\",\n          group: \"b\"\n        });\n      }\n\n      if (this.searchForm.notPublish) {\n        query.push({\n          property: \"isPublish\",\n          operation: \"EQUAL\",\n          value: 0,\n          relation: \"OR\",\n          group: \"b\"\n        });\n      }\n\n      this.pageResult.page = page;\n      this.loadData(query);\n    },\n    itemClick: function itemClick(item, $event) {\n      $event.preventDefault();\n\n      if (this.selectIdList.includes(item.id)) {\n        this.selectIdList.remove(item.id);\n        this.$set(item, \"checked\", false);\n      } else {\n        this.selectIdList.push(item.id);\n        this.$set(item, \"checked\", true);\n      }\n    },\n    tagSet: function tagSet(app) {\n      this.selectId = app.id;\n      this.tagDialogVisible = true;\n      this.loadAppTagsType();\n      this.loadAppTags(app.id);\n    },\n    //加载旧数据\n    loadAppTags: function loadAppTags(appId) {\n      var _this11 = this;\n\n      req.get(window.context.portal + \"/portal/sysApp/v1/getAppTagsById/\" + appId).then(function (resp) {\n        if (resp.data.state && resp.data.value && resp.data.value.length != 0) {\n          _this11.appTags = [];\n          resp.data.value.forEach(function (item) {\n            _this11.appTags.push(item.tagId);\n          });\n        }\n      });\n    },\n    //获取标签分类\n    loadAppTagsType: function loadAppTagsType() {\n      var _this12 = this;\n\n      req.get(window.context.portal + \"/sys/sysType/v1/getTreeDateByTypeKey?typeKey=yybq\").then(function (resp) {\n        _this12.appTagList = resp.data;\n\n        _this12.loadSysTag();\n      });\n    },\n    //加载标签到options\n    loadSysTag: function loadSysTag() {\n      this.appTagList.forEach(function (item) {\n        var querys = [{\n          property: \"type_id_\",\n          value: item.id,\n          group: \"main\",\n          operation: \"EQUAL\",\n          relation: \"AND\"\n        }];\n        var filter = {\n          querys: querys\n        };\n        req.post(window.context.portal + \"/portal/sysTag/v1/query\", filter).then(function (resp) {\n          item.children = resp.data.rows;\n        });\n      });\n    },\n    appTagSave: function appTagSave() {\n      var _this13 = this;\n\n      req.post(window.context.portal + \"/portal/sysApp/v1/saveAppTags/\" + this.selectId, this.appTags.join(\",\")).then(function (resp) {\n        if (resp.data.state) {\n          _this13.$message({\n            type: \"success\",\n            message: resp.data.message\n          });\n\n          _this13.tagDialogVisible = false;\n        }\n      });\n    },\n    //跳转到标签配置页面\n    tagConfig: function tagConfig() {\n      this.$router.push(\"/meta#sysTagManager\");\n    },\n    handleExport: function handleExport() {\n      if (this.selectIdList.length === 0) {\n        this.$message.warning(\"请选择至少一项记录\");\n        return;\n      }\n\n      var url = \"\".concat(window.context.portal, \"/portal/sysApp/v1/exportXml?ids=\").concat(this.selectIdList);\n      req.download(url);\n    },\n    handleUploadResult: function handleUploadResult(data) {\n      if (data.state) {\n        if (data.message.includes(\"已存在故跳过\")) {\n          this.$message({\n            type: \"warning\",\n            message: data.message,\n            showClose: true,\n            duration: 5000,\n            dangerouslyUseHTMLString: true\n          });\n        } else {\n          this.$message({\n            type: \"success\",\n            message: \"导入成功\"\n          });\n        }\n      } else {\n        this.$message({\n          type: \"error\",\n          message: data.message\n        });\n      }\n\n      this.importDialogVisible = false;\n      this.fullscreenLoading = false;\n      this.search(1);\n    },\n    beforeUpload: function beforeUpload(file) {\n      if (!file.name.endsWith(\".zip\")) {\n        this.$message.warning(\"只能导入zip文件!\");\n        return false;\n      }\n\n      this.fullscreenLoading = true;\n    },\n    onExceed: function onExceed(file) {\n      this.$message.warning(\"只能选择一个zip文件!\");\n    },\n    uploadSubmit: function uploadSubmit() {\n      if (!this.$refs.upload.uploadFiles || this.$refs.upload.uploadFiles.length === 0) {\n        this.$message.warning(\"请选择要导入的应用!\");\n        return false;\n      }\n\n      this.$refs.upload.submit();\n    }\n  }\n};",null]}