{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/view_treeview.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/components/view_treeview.vue","mtime":1739760944327},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport view_listview from \"@/components/view_listview.vue\";\nimport form_normalform from \"@/components/form_normalform.vue\";\nimport form_searchform from \"@/components/form_searchform.vue\";\nexport default {\n name: \"view_treeview\",\n props: [\"view\", \"isView\", \"mutil\", \"selectOne\", \"openParams\", \"isSearchForm\"],\n components: {\n view_listview: view_listview,\n form_normalform: form_normalform,\n form_searchform: form_searchform\n },\n data: function data() {\n return {\n defaultProps: {\n label: 'label',\n children: 'children',\n isLeaf: 'leaf'\n },\n arrNodes: [],\n treeViewData: [],\n isDisplay: false,\n treeview: '',\n openParam: '',\n parentId: '',\n isRouterAlive: true,\n isFormRouter: true,\n isTreeRouterAlive: true,\n tags: [],\n // 右侧选中的数组\n loading: this.$t('view.loading'),\n currentDocIds: [],\n hasChildren: '',\n menuVisible: false,\n currentRightNodeId: '',\n //当前右键选择中的节点\n filterText: '',\n // 输入框的内容\n searchValue: '',\n node_had: '',\n resolve_had: '',\n showSearchPanel: false,\n // 是否显示弹窗面板\n isSearchOperation: false,\n linkUrl: '',\n //外部链接\n clickTreeDocId: '',\n linkVoJson: '',\n treeData: [],\n //默认展示二级\n appId: null // 防止openParams缺失属性appId\n };\n },\n computed: {\n menus: function menus() {\n var list = this.view.activities;\n list.forEach(function (item) {\n switch (item.type) {\n case 1:\n item.setClass = \"glyphicon glyphicon-list\";\n break;\n case 2:\n item.setClass = \"glyphicon glyphicon-plus\";\n break;\n case 3:\n item.setClass = \"glyphicon glyphicon-trash\";\n break;\n case 16:\n item.setClass = \"glyphicon glyphicon-log-out\";\n break;\n case 18:\n item.setClass = \"glyphicon glyphicon-erase\";\n break;\n case 20:\n item.setClass = \"glyphicon glyphicon-send\";\n break;\n case 26:\n item.setClass = \"glyphicon glyphicon-save\";\n break;\n case 27:\n item.setClass = \"glyphicon glyphicon-log-in\";\n break;\n case 29:\n item.setClass = \"glyphicon glyphicon-globe\";\n break;\n case 34:\n item.setClass = \"glyphicon glyphicon-file\";\n break;\n case 36:\n item.setClass = \"glyphicon glyphicon-print\";\n break;\n case 43:\n item.setClass = \"glyphicon glyphicon-new-window\";\n break;\n default:\n break;\n }\n });\n return list;\n }\n },\n watch: {\n filterText: function filterText(val) {\n var _this = this;\n if (this.$refs.deptTree) {\n this.$refs.deptTree.filter(val);\n this.$nextTick(function () {\n if (document.getElementsByClassName('el-tree__empty-text')[0]) {\n document.getElementsByClassName('el-tree__empty-text')[0].innerText = _this.$t('nodata');\n }\n });\n } else {\n this.$refs.viewTree.filter(val);\n this.$nextTick(function () {\n if (document.getElementsByClassName('el-tree__empty-text')[0]) {\n document.getElementsByClassName('el-tree__empty-text')[0].innerText = _this.$t('nodata');\n }\n });\n }\n }\n },\n created: function created() {\n if (!this.openParams.appId) {\n this.appId = this.$route.query.appId;\n }\n },\n mounted: function mounted() {\n if (!this.isView) {\n var view = this.view;\n if (view.linkVoJson) {\n this.linkVoJson = JSON.parse(view.linkVoJson);\n }\n this.getTemplete();\n }\n },\n methods: {\n openDialogJump: function openDialogJump(params, type) {\n this.$parent.openDialogJump(params, type);\n },\n setSearchDocItems: function setSearchDocItems(doc) {\n //view-listview调用了\n this.$parent.setSearchDocItems(doc);\n },\n onloadTree: function onloadTree() {\n this.$emit(\"updateView\");\n },\n onClickBtn: function onClickBtn(item) {\n if (item.type == 2 || item.type == 3) {\n this.handleBtn(item.type, item);\n } else {\n this.$parent.onAction(item);\n }\n },\n //右键删除树形节点\n deleteTreeNode: function deleteTreeNode() {\n var _this2 = this;\n this.$api.deleteTreeviewNode(this.openParams.appId, this.currentRightNodeId, {\n onSucess: function onSucess(res) {\n if (res.data.errcode == 0) {\n _this2.$notify({\n title: _this2.$t('success'),\n message: '',\n type: 'success'\n });\n _this2.$emit(\"updateView\");\n }\n }\n });\n },\n //当树形视图完全为空的时候,右键显示\n emptyRightClick: function emptyRightClick(e) {\n if (this.view.activities[0].contextMenu || this.view.activities[1].contextMenu) {\n this.rightMenu = {\n top: e.pageY + 8 + 'px',\n left: e.pageX + 'px'\n };\n this.menuVisible = true;\n var self = this;\n document.onclick = function (ev) {\n if (ev.target !== document.getElementById('perTreeMenu')) {\n self.menuVisible = false;\n }\n };\n }\n },\n rightClick: function rightClick(e, data, node, comp) {\n if (this.view.activities[0].contextMenu || this.view.activities[1].contextMenu) {\n this.currentRightNodeId = data.key;\n this.rightMenu = {\n top: e.pageY + 8 + 'px',\n left: e.pageX + 'px'\n };\n this.menuVisible = true;\n var self = this;\n document.onclick = function (ev) {\n if (ev.target !== document.getElementById('perTreeMenu')) {\n self.menuVisible = false;\n }\n };\n }\n },\n setDocIds: function setDocIds(val, hasChildren) {\n this.currentDocIds = val;\n this.hasChildren = hasChildren;\n },\n checkedNodes: function checkedNodes(node) {\n var res = this.$refs.viewTree.getCheckedNodes();\n var arr = [];\n if (res && res.length > 0) {\n this.tags = [];\n var select = '';\n for (var i = 0; i < res.length; i++) {\n var obj = {};\n obj.name = res[i].label;\n obj.docId = res[i].key;\n this.tags.push(obj);\n select += res[i].rows.docId + \";\";\n arr.push(res[i].rows);\n }\n var params = {\n linkType: \"00\",\n appId: this.openParams.appId,\n actionContent: node.formId,\n _select: select,\n viewId: this.view.id\n };\n this.$emit(\"updateViewData\", params, arr);\n } else {\n var _params = {\n linkType: \"00\",\n appId: this.openParams.appId,\n actionContent: node.formId,\n _select: '',\n viewId: this.view.id\n };\n this.$emit(\"updateViewData\", _params, arr);\n }\n },\n handleBtn: function handleBtn(type, item) {\n switch (type) {\n case 2:\n // let params = {\n // linkType: \"00\",\n // appId: this.openParams.appId,\n // active: true,\n // name:'树形视图',\n // actionContent: item.onActionForm,\n // refreshId:this.openParams.id, \n // };\n // this.$emit(\"add-tab\", params)\n var extraParams = {\n treedocid: this.clickTreeDocId,\n document: {},\n innerType: this.view.innerType\n };\n this.$parent.runBeforeAction(item, [], extraParams);\n break;\n case 3:\n if (this.hasChildren) {\n this.$message({\n message: this.$t('view.del_child_node'),\n type: 'warning'\n });\n } else {\n var res = this.$refs.deptTree.getCheckedNodes();\n var arr = [];\n for (var i = 0; i < res.length; i++) {\n arr.push(res[i].key);\n }\n arr = arr.concat(this.currentDocIds);\n this.$emit(\"deleted\", item, arr);\n }\n break;\n default:\n break;\n }\n },\n getTemplete: function getTemplete(node, resolve) {\n var _this3 = this;\n var view = this.view;\n var openParams = this.openParams;\n if (node) {\n this.clickTreeDocId = node.key;\n }\n if (!this.isView) {\n //如果不是视图选择框\n if (this.view.innerType && this.view.innerType == 'VIEW') {\n var params = {\n linkType: \"01\",\n appId: this.openParams.appId,\n actionContent: this.view.id,\n parentId: node ? node.key : '',\n viewId: \"\",\n id: this.openParams.id\n };\n this.openParam = params;\n var appId = this.openParams.appId;\n var linkViewId = this.view.id;\n var hasListview = true;\n if (!node) {\n this.$api.getTreeViewTemplate(appId, linkViewId, hasListview, {\n onSucess: function onSucess(response) {\n _this3.treeview = response.data.data;\n }\n });\n } else {\n this.parentId = node.key;\n var _params2 = {\n appId: this.openParams.appId,\n viewId: this.view.id,\n hasListview: true,\n hasTreeview: true,\n parentId: node.key,\n isTreeView: true,\n opentarget: \"detail\",\n treedocid: node.key\n };\n this.$api.getViewTemplateP(appId, this.view.id, _params2, {\n onSucess: function onSucess(response) {\n if (response.data.data) {\n //this.parentId = node.key;\n _this3.treeview = response.data.data;\n _this3.$refs.treeView.setTreeViewData(node.key);\n //this.reload();\n }\n }\n });\n }\n } else if (this.view.innerType && this.view.innerType == 'FORM') {\n if (!node) {\n var _params3 = {\n linkType: \"00\",\n appId: this.openParams.appId,\n actionContent: this.view.relatedForm,\n _select: \"\",\n viewId: \"\"\n };\n this.treeview = _params3;\n } else {\n var _params4 = {\n linkType: \"00\",\n appId: this.openParams.appId,\n actionContent: this.view.relatedForm,\n _select: node.key,\n viewId: \"\"\n };\n this.treeview = _params4;\n var value = \"FORM\";\n this.reload(value);\n }\n } else if (this.view.innerType && this.view.innerType == 'LINK') {\n if (JSON.parse(this.view.linkVoJson).type == \"06\") {\n //外部链接\n this.linkUrl = this.view.linkViewId;\n } else {\n var linkVoJson = JSON.parse(view.linkVoJson);\n var _params5 = {};\n if (linkVoJson.type == \"00\") {\n _params5 = {\n linkType: \"00\",\n appId: openParams.appId,\n actionContent: view.linkViewId,\n parentId: node ? node.key : '',\n viewId: \"\",\n refreshId: openParams.id,\n isTreeViewLink: true,\n treedocid: this.clickTreeDocId\n };\n this.openParam = _params5;\n var _appId = openParams.appId;\n var _linkViewId = view.id;\n var _hasListview = '';\n if (!node) {\n this.$api.getTreeViewTemplate(_appId, _linkViewId, _hasListview, {\n onSucess: function onSucess(response) {\n _this3.treeview = response.data.data;\n }\n });\n } else {\n this.$api.getViewTemplateP(_appId, this.view.id, node.key, {\n onSucess: function onSucess(response) {\n if (response.data.data) {\n _this3.treeview = response.data.data;\n _this3.parentId = node.key;\n // this.reload();\n }\n }\n });\n }\n } else if (linkVoJson.type == \"01\") {\n _params5 = {\n linkType: \"01\",\n appId: openParams.appId,\n actionContent: view.linkViewId,\n parentId: node ? node.key : '',\n viewId: \"\",\n refreshId: openParams.id,\n isTreeViewLink: true,\n treedocid: node ? node.key : ''\n };\n this.openParam = _params5;\n var _appId2 = openParams.appId;\n var _linkViewId2 = view.linkViewId;\n var _hasListview2 = true;\n if (!node) {\n this.$api.getTreeViewTemplate(_appId2, _linkViewId2, _hasListview2, {\n onSucess: function onSucess(response) {\n _this3.treeview = response.data.data;\n }\n });\n } else {\n this.$api.getViewTemplateP(_appId2, this.view.id, node.key, {\n onSucess: function onSucess(response) {\n if (response.data.data) {\n _this3.treeview = response.data.data;\n _this3.parentId = node.key;\n _this3.reload();\n }\n }\n });\n }\n }\n }\n }\n } else {\n var arr = [];\n arr.push(node.rows);\n var isRadio = true;\n var _params6 = {\n linkType: \"00\",\n appId: this.openParams.appId,\n actionContent: node.formId,\n _select: node.key,\n viewId: this.view.id\n };\n this.$emit(\"updateViewData\", _params6, arr, isRadio);\n }\n },\n getExcelParams: function getExcelParams() {\n if (this.searchExcelData) {\n return this.searchExcelData;\n } else {\n return \"\";\n }\n },\n reload: function reload(value) {\n var _this4 = this;\n if (value == \"FORM\") {\n this.isFormRouter = false;\n this.$nextTick(function () {\n return _this4.isFormRouter = true;\n });\n } else {\n this.isRouterAlive = false;\n this.$nextTick(function () {\n return _this4.isRouterAlive = true;\n });\n }\n },\n handleIconSearch: function handleIconSearch(value) {\n // 【暂时先注释,通过element的方法实现筛选】\n this.node_had.childNodes = []; //把存起来的node的子节点清空,不然会界面会出现重复树!\n this.loadNode(this.node_had, this.resolve_had, value); //再次执行懒加载的方法\n // this.filterText = value\n },\n loadNode: function loadNode(node, resolve, searchValue) {\n var _this5 = this;\n var op = this.openParams;\n if (!this.node_had) {\n this.node_had = node; //这里是关键!在data里面定义一个变量,将node.level == 0的node存起来\n }\n if (!this.resolve_had) {\n this.resolve_had = resolve;\n }\n\n //同上,把node.level == 0的resolve也存起来\n var name = searchValue ? searchValue : '';\n if (node.level === 0) {\n this.$api.getTreeViewData(this.openParams.appId || this.appId, this.view.id, {\n parentId: op.parentId,\n isRelate: op.isRelate,\n rootNode: true,\n name: name ? name : '',\n isSearchForm: this.isSearchForm\n }, {}, name, {\n onSucess: function onSucess(response) {\n var viewData = response.data;\n _this5.treeViewData = response.data.data.data;\n if (viewData.data.data && viewData.data.data.length > 0) {\n _this5.clickTreeDocId = viewData.data.data[0].id;\n _this5.isSearchOperation = false;\n var nodes = [];\n _this5.view.columns.forEach(function (clm) {\n if (clm.mappingField == \"name_Node\") {\n viewData.data.data.forEach(function (doc) {\n var rows = {};\n rows.formId = doc.formId;\n rows.docId = doc.id;\n for (var key in doc.items) {\n var items = doc.items[key];\n rows[key] = items.value;\n }\n var label = doc.items[clm.id].value;\n nodes.push({\n key: doc.id,\n level: 0,\n label: label,\n children: doc.children,\n formId: doc.formId,\n row_count: doc.row_count,\n rows: rows,\n leaf: doc.children ? false : true\n });\n });\n }\n });\n _this5.arrNodes = nodes;\n resolve(_this5.arrNodes);\n if (_this5.arrNodes.length) {\n //展开第一个节点的二级菜单\n _this5.arrNodes.forEach(function (item, index) {\n if (index == _this5.arrNodes.length - 1 && item.children) {\n //默认只展开最后一级目录\n _this5.treeData.push(item.key);\n }\n });\n }\n } else if (viewData.data.data.length == 0) {\n _this5.loading = \" \";\n _this5.isDisplay = true;\n if (searchValue) {\n _this5.isSearchOperation = true;\n }\n }\n }\n });\n } else {\n this.$api.getTreeViewData(this.openParams.appId || this.appId, this.view.id, {\n parentId: node.key,\n isSearchForm: this.isSearchForm\n }, {}, \"\", {\n onSucess: function onSucess(response) {\n var viewData = response.data;\n _this5.treeViewData = response.data.data.data;\n if (viewData.data.data && viewData.data.data.length > 0) {\n _this5.isSearchOperation = false;\n var nodes = [];\n _this5.view.columns.forEach(function (clm) {\n if (clm.mappingField == \"name_Node\") {\n viewData.data.data.forEach(function (doc) {\n var rows = {};\n rows.formId = doc.formId;\n rows.docId = doc.id;\n for (var key in doc.items) {\n var items = doc.items[key];\n rows[key] = items.value;\n }\n var label = doc.items[clm.id].value;\n nodes.push({\n key: doc.id,\n level: 0,\n label: label,\n children: doc.children,\n formId: doc.formId,\n row_count: doc.row_count,\n rows: rows,\n leaf: doc.children ? false : true\n });\n });\n }\n });\n //this.arrNodes = nodes\n // console.log(\"nodes-2--->\",nodes)\n resolve(nodes);\n } else if (viewData.data.data.length == 0) {\n var _nodes = [];\n resolve(_nodes);\n _this5.isDisplay = true;\n if (searchValue) {\n _this5.isSearchOperation = true;\n }\n }\n }\n });\n }\n },\n getTreeView: function getTreeView() {\n var _this6 = this;\n this.$api.getTreeViewData(this.openParams.appId, this.view.id, {\n parentId: \"\"\n }, {}, \"\", {\n onSucess: function onSucess(response) {\n var viewData = response.data;\n _this6.treeViewData = response.data.data.data;\n if (viewData.data.data && viewData.data.data.length > 0) {\n var nodes = [];\n _this6.view.columns.forEach(function (clm) {\n if (clm.mappingField == \"current_Node\") {\n viewData.data.data.forEach(function (doc) {\n var label = doc.items[clm.id].value;\n nodes.push({\n key: doc.id,\n level: 0,\n label: label,\n children: doc.children,\n formId: doc.formId\n });\n });\n }\n });\n _this6.arrNodes = nodes;\n // console.log(\"this.treeViewData--->\",this.treeViewData)\n // console.log(\"arrNodes--->\",this.arrNodes);\n } else if (viewData.data.data.length == 0) {\n _this6.isDisplay = true;\n }\n }\n });\n },\n reloadListView: function reloadListView() {\n var _this7 = this;\n this.isTreeRouterAlive = false;\n this.$nextTick(function () {\n return _this7.isTreeRouterAlive = true;\n });\n this.isRouterAlive = false;\n this.$nextTick(function () {\n return _this7.isRouterAlive = true;\n });\n // this.getTreeView(this.currentPage, 10, \"\");\n },\n // 重置数组\n reset: function reset() {\n // 清空右侧的内容\n this.tags = [];\n // 清空左侧选中的内容\n this.$refs.viewTree.setCheckedKeys([]);\n },\n /**\n * 点击tag的删除\n */\n handleClose: function handleClose(tag) {\n // 删除右侧的数据\n this.tags.splice(this.tags.indexOf(tag), 1);\n // 获取左侧所有数据\n var leftData = this.$refs.viewTree.getCheckedNodes();\n var keys = [];\n // 筛选左侧需要显示的值\n leftData.filter(function (item) {\n return item.label != tag.name;\n }).map(function (item2) {\n return keys.push(item2.key);\n });\n this.$refs.viewTree.setCheckedKeys(keys);\n },\n /**\n * 点击查询获取值\n */\n onSearch: function onSearch(searchData, data) {\n this.filterText = data[this.$t('view.this_node')];\n },\n /**\n * 筛选显示的节点\n */\n filterNode: function filterNode(value, data) {\n if (!value) return true;\n if (data.label.indexOf(value) !== -1) {\n return data.label.indexOf(value) !== -1;\n } else {\n return false;\n }\n },\n /**\n * 搜索的下来弹窗\n */\n onSearchTree: function onSearchTree(data) {\n this.filterText = data[this.$t('view.this_node')] || data[this.$t('view.node_id')] || data[this.$t('view.parent_id')];\n }\n }\n};",null]}