{"remainingRequest":"/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/Common/nodeLink_select.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/Common/nodeLink_select.vue","mtime":1701674859499},{"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":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 { getModuleFormList } from '@/service/FormApi.js'\nimport {\n getModuleViewList,\n reqLinkDetail,\n reqLinkList,\n updateLinkDetail,\n delLinkList,\n addLinkDetail,\n} from '@/service/ViewApi.js'\nimport { getAllmodules } from '@/service/CommonApi.js'\nimport { nameCheck } from '@/utils/utils.js'\nimport {delMsg} from '@/utils/elementui'\nexport default {\n data() {\n return {\n params: {\n appId: '',\n moduleId: '',\n searchword: '',\n type: '',\n viewId: '',\n pageNo: 1,\n linesPerPage: 10,\n name: '',\n description: '',\n },\n linkInline: {\n name: '', // 名称\n type: '', // 类型\n },\n content: {\n name: '', // 名称\n type: '00', // 类型\n moduleid: '', // 模块\n queryString: '', // 参数\n actionForm: '', // 作用表单\n actionView: '', // 作用视图\n directory: 'portal', // 自定义链接\n externalLinks: '', // 扩展链接\n tb: [\n // 参数\n {\n paramKey: '',\n paramValue: '',\n },\n ],\n description: '', // 描述\n },\n showLinkType: true,\n contentRules: {\n name: [\n { required: true, message: this.$t('placeholder.name'), trigger: 'blur' },\n { validator: nameCheck, trigger: 'blur' },\n ],\n },\n allmodulesData: [], // 模块的数据\n moduleFormOptions: [], //作用表单\n moduleViewOptions: [], // 作用视图\n delCheckBoxData: [], // checkbox选中的值\n isEdit: false, // 是否为编辑状态\n loading: true,\n nodeLinkData: {}, // 节点链接列表\n nodeLinkParams: {\n name: '',\n type: '',\n pageNo: 1,\n linesPerPage: 10,\n },\n }\n },\n methods: {\n // 弹框关闭回调\n handleClose() {\n this.isEdit = false\n this.onReset()\n this.logoutLinkType('contentForm')\n this.$emit('closeNodeLink')\n },\n // 表格查询\n onSearch() {\n this.nodeLinkParams = {\n ...this.nodeLinkParams,\n name: this.linkInline.name,\n type: this.linkInline.type\n }\n this.getNodeLinkList()\n },\n // 链接添加\n addNodeLink() {\n this.showLinkType = false\n },\n // 表格和表单重置重置\n onReset() {\n this.linkInline.name = ''\n this.linkInline.type = ''\n this.$emit('resetNodeLinkData')\n },\n // 链接编辑\n handleEdit(index, row) {\n this.getLinkDetail(row.id)\n this.isEdit = true\n let params = {\n ...this.params,\n appId: sessionStorage.getItem('appId'),\n moduleId: row.moduleid,\n searchword: '',\n viewId: '',\n pageNo: 1,\n linesPerPage: 100000,\n id: row.id,\n }\n this.params = params\n if (row.type == '00') {\n this.getListFrom(params)\n } else if (row.type == '01') {\n this.getListView(params)\n }\n this.showLinkType = false\n },\n // 选中表格前面的那个复选框\n handleSelectionChange(row) {\n this.delCheckBoxData = row\n },\n // 批量删除表格选中的数据\n async delSelectData() {\n let ids = []\n this.delCheckBoxData.map((item) => ids.push(item.id))\n if(this.delCheckBoxData.length > 0) {\n try{\n await delMsg(this.$t('msg.delConfirm'), this.$t('msg.tip'))\n const response = await delLinkList(ids)\n console.log(response,'response')\n if (response.data.errcode == 0) {\n this.$message.success(response.data.data)\n this.getNodeLinkList()\n }\n }catch(e){\n console.log(e)\n }\n }else {\n this.$message.error(this.$t('msg.check_data'))\n } \n },\n // 清除【清空输入框的值】\n clearSelectData() {\n this.$parent.clearLinkName()\n this.handleClose()\n },\n /**\n * 切换分页,每页显示多少条\n */\n handleSizeChange(val) {\n this.nodeLinkParams.linesPerPage = val\n this.getNodeLinkList()\n },\n /**\n * 当前页\n */\n handleCurrentChange(val) {\n this.nodeLinkParams.pageNo = val\n this.getNodeLinkList()\n },\n // 点击表格字段\n handleClick(row) {\n this.$emit('selectNodeLinkValue', row)\n this.handleClose()\n },\n\n /**\n * 节点链接 查询\n */\n nodeLinkSearch(val) {\n this.nodeLinkParams.name = val.name\n this.nodeLinkParams.type = val.type\n this.getNodeLinkList()\n },\n\n /**\n * 节点链接 重置\n */\n resetNodeLinkData() {\n this.nodeLinkParams = {\n name: '',\n type: '',\n pageNo: 1,\n linesPerPage: 10,\n }\n this.getNodeLinkList()\n },\n // 表单保存\n saveLinkType() {\n let actionContent\n if (this.content.type == '00') {\n actionContent = this.content.actionForm\n } else if (this.content.type == '01') {\n actionContent = this.content.actionView\n } else if (this.content.type == '05' || this.content.type == '06') {\n actionContent = this.content.externalLinks\n }\n let params = {\n ...this.content,\n actionContent,\n queryString: JSON.stringify(this.content.tb),\n applicationid: sessionStorage.getItem('appId'),\n parentId: sessionStorage.getItem('appId'),\n }\n // 更新\n if (this.isEdit) {\n params.id = this.params.id\n updateLinkDetail(params, {\n onSucess: (response) => {\n if (response.data.errcode == 0) {\n this.$message.success(this.$t('msg.update_ss'))\n this.logoutLinkType('contentForm')\n this.$parent.resetNodeLinkData()\n }\n },\n })\n } else {\n // 新建\n addLinkDetail(sessionStorage.getItem('appId'), params, {\n onSucess: (response) => {\n if (response.data.errcode == 0) {\n this.$message.success(this.$t('msg.created_ss'))\n this.logoutLinkType('contentForm')\n this.$parent.resetNodeLinkData()\n }\n },\n })\n }\n setTimeout( () => {\n //保证保存成功即时刷新当前弹框界面\n this.getNodeLinkList()\n },200)\n },\n // 表单退出\n logoutLinkType(formName) {\n this.content = {\n name: '', // 名称\n type: '00', // 类型\n moduleid: '', // 模块\n actionForm: '', // 作用表单\n actionView: '', // 作用视图\n directory: 'portal', // 自定义链接\n externalLinks: '', // 扩展链接\n queryString: '', // 参数\n tb: [\n // 参数\n {\n paramKey: '',\n paramValue: '',\n },\n ],\n description: '', // 描述\n }\n if (this.$refs[formName]) {\n this.$refs[formName].resetFields()\n }\n this.isEdit = false\n this.showLinkType = true\n },\n // 添加表单单行参数\n addTbParamsSystem() {\n this.content.tb.push({ paramKey: '', paramValue: '' })\n },\n // 删除表单单行参数\n delTbParamsSystem(index) {\n this.content.tb.splice(index, 1)\n },\n // 表单类型的改变\n changeContentType() {\n this.content.moduleid = ''\n ;(this.content.actionForm = ''), // 作用表单\n (this.content.actionView = '') // 作用视图\n },\n // 表单模块的改变\n changeModules() {\n this.moduleFormOptions = []\n this.moduleViewOptions = []\n let params = {\n ...this.params,\n appId: sessionStorage.getItem('appId'),\n moduleId: this.content.moduleid,\n name: '',\n description: '',\n viewId: '',\n pageNo: 1,\n linesPerPage: 100000,\n }\n // 清空作用表单视图的值\n this.content.actionForm = ''\n this.content.actionView = ''\n this.content.externalLinks = ''\n if (this.content.type == '00') {\n this.getListFrom(params)\n } else if (this.content.type == '01') {\n this.getListView(params)\n }\n },\n /**\n * 获取作用表单\n */\n getListFrom(params) {\n this.loading = true\n getModuleFormList(params, {\n onSucess: (response) => {\n this.loading = false\n if (response.data.errcode == 0) {\n let data = response.data.data.datas\n let dataArr = []\n for (let i = 0; i < data.length; i++) {\n if (data[i].type == 1) {\n dataArr.push(data[i])\n }\n }\n this.moduleFormOptions = dataArr\n }\n },\n })\n },\n /**\n * 获取作用视图\n */\n getListView(params) {\n this.loading = true\n getModuleViewList(params, {\n onSucess: (response) => {\n this.loading = false\n if (response.data.errcode == 0) {\n this.moduleViewOptions = response.data.data.datas\n }\n },\n })\n },\n\n /**\n * 获取链接详情列表\n */\n getLinkDetail(linkId) {\n this.loading = true\n reqLinkDetail(linkId, {\n onSucess: (response) => {\n if (response.data.errcode == 0) {\n this.loading = false\n let data = response.data.data\n // console.log(data)\n this.content = {\n name: data.name, // 名称\n type: data.type, // 类型\n moduleid: data.moduleid, // 模块\n queryString: data.queryString, // 参数\n actionForm: data.type == '00' ? data.actionContent : '', // 作用表单\n actionView: data.type == '01' ? data.actionContent : '', // 作用视图\n directory: data.directory, // 自定义链接\n externalLinks:\n data.type == '05' || data.type == '06'\n ? data.actionContent\n : '', // 扩展链接\n tb: data.queryString ? eval(data.queryString) : [],\n description: data.description, // 描述\n }\n }\n },\n })\n },\n /**\n * 获取所有模块\n */\n /**\n * 获取菜单树形结构所有模块列表\n */\n async getAllmodules() {\n let appId = sessionStorage.getItem('appId')\n let currentModuleId = ''\n this.loading = true\n let response = await getAllmodules(appId, currentModuleId)\n if (response.data.errcode == 0) {\n this.loading = false\n this.allmodulesData = response.data.data\n }\n },\n /**\n * 获取节点链接的数据\n */\n getNodeLinkList() {\n let params = {\n ...this.nodeLinkParams,\n appId: sessionStorage.getItem('appId'),\n }\n reqLinkList(params, {\n onSucess: (response) => {\n if (response.data.errcode == 0) {\n let data = response.data.data.datas\n for (let i = 0; i < data.length; i++) {\n if (data[i].type == '00') {\n data[i].typeName = this.$t('view.form')\n } else if (data[i].type == '01') {\n data[i].typeName = this.$t('view.view')\n } else if (data[i].type == '05') {\n data[i].typeName = this.$t('label.url_in')\n } else if (data[i].type == '06') {\n data[i].typeName = this.$t('label.url_out')\n } else if (data[i].type == '08') {\n data[i].typeName = this.$t('label.email_url')\n }\n }\n this.nodeLinkData = response.data.data\n }\n },\n })\n },\n },\n created() {\n this.getAllmodules()\n this.getNodeLinkList()\n },\n props: {\n nodeLinkVisiable: {\n type: Boolean,\n },\n },\n computed: {\n showModule() {\n return this.content.type != '05' && this.content.type != '06'\n },\n },\n}\n",null]}