{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/view_collapsibleview.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/view_collapsibleview.vue","mtime":1725957645731},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["\nimport form_searchform from \"@/components/form_searchform.vue\";\nexport default {\n name: \"view-collapsibleview\",\n props: [\n \"view\",\n \"openParams\",\n \"showtype\",\n \"toTab\"\n ],\n provide () {\n return {\n calctextJump: this.calctextJump\n }\n },\n components: {\n form_searchform,\n },\n watch: {\n \n },\n computed: {\n \n },\n\n mounted() {\n this.getData();\n },\n\n data: function() {\n return {\n checkedAll:[],\n currentPage: 1,\n tableData:[],\n row_count:0,\n loading: true,\n emptyData:'',\n isOpenTemplate: false,\n };\n },\n\n methods: {\n setChildren(children, type) {\n // 编辑多个子层级\n children.map(j => {\n this.toggleSelection(j, type)\n if (j.children) {\n this.setChildren(j.children, type)\n }\n })\n },\n // 选中父节点时,子节点一起选中取消\n select(selection, row) { \n // alert(7)\n // debugger\n const hasSelect = selection.some(el => {\n return row.docId === el.docId\n })\n if (hasSelect) {\n console.log(selection)\n console.log(row)\n this.$nextTick(() => { \n this.$refs.multipleTable.toggleRowSelection(row,true); \n })\n\n // if (row.children) {\n // // 解决子组件没有被勾选到\n // this.setChildren(row.children, true)\n // }\n } else {\n this.$nextTick(() => {\n this.$refs.multipleTable.toggleRowSelection(row,false) \n })\n\n // if (row.children) {\n // this.setChildren(row.children, false)\n // }\n }\n },\n toggleSelection(row, select) {\n if (row) {\n this.$nextTick(() => {\n this.$refs.multipleTable &&\n this.$refs.multipleTable.toggleRowSelection(row, select)\n })\n }\n },\n // 选择全部\n selectAll(selection) {\n // tabledata第一层只要有在selection里面就是全选\n const isSelect = selection.some(el => {\n const tableDataIds = this.tableData.map(j => j.id)\n return tableDataIds.includes(el.id)\n })\n // tableDate第一层只要有不在selection里面就是全不选\n const isCancel = !this.tableData.every(el => {\n const selectIds = selection.map(j => j.id)\n return selectIds.includes(el.id)\n })\n if (isSelect) {\n selection.map(el => {\n if (el.children) {\n // 解决子组件没有被勾选到\n this.setChildren(el.children, true)\n }\n })\n }\n if (isCancel) {\n this.tableData.map(el => {\n if (el.children) {\n // 解决子组件没有被勾选到\n this.setChildren(el.children, false)\n }\n })\n }\n },\n\n \n getSearchDocument(doc){\n this.$parent.setSearchDocItems(doc);\n },\n\n onSearch(searchData, data) {\n let page = 1;\n this.searchExcelData = data;\n this.getData(page, searchData);\n },\n\n handleOpenSearchTemplate() {\n this.isOpenTemplate = !this.isOpenTemplate;\n },\n\n //o-action跳转\n calctextJump(openType, params, jumpType,styleParams) {\n if(styleParams) {\n params.styleParams = styleParams;\n }\n params.name = params.title || this.view.name\n let showtype = this.showtype\n if(showtype && (showtype == 'tab' || 'include') && params.isRefresh) {\n if(showtype == 'include') {\n params.isIncludeCreate = \"include\"\n }else if(showtype == 'tab'){\n params.isTabCreate = 'tab'\n }\n params.randomRefreshId = new Date().getTime()\n params.templateId = this.view.id\n // this.$parent.setViewRefreshId(params.randomRefreshId)\n }\n if(jumpType === 'opendocument') {\n if (openType == \"open-eject\" || openType == \"dialog\") {\n let type = \"FORM\";\n this.$parent.openDialogJump(params,type)\n }else if (openType == \"open-present\") {\n this.$emit(\"openNewpage\",params)\n }else if (openType == \"open-blank\"){\n let routeData = this.$router.resolve({\n name: 'open',\n query: params,\n });\n window.open(routeData.href, \"_blank\");\n }else {//默认用tab方式打开\n // this.$emit(\"add-tab\", params);\n params.openType = Common.openType_TAB\n params.refreshId = this.openParams.id, //判断是否得刷新\n this.addTab(params)\n }\n }else if(jumpType === 'openview') {\n if (openType == \"open-eject\" || openType == \"dialog\") {\n let type = \"VIEW\";\n this.$parent.openDialogJump(params,type);\n }else if (openType == \"open-present\") {\n this.$emit(\"openNewpage\",params)\n }else if (openType == \"open-blank\"){\n let routeData = this.$router.resolve({\n name: \"view_blank\",\n query: params,\n });\n window.open(routeData.href, \"_blank\");\n }else {//默认用tab方式打开\n params.refreshId = this.openParams.id //判断是否得刷新\n params.id = params.actionContent + \"_\" + this.view.id\n this.addTab(params)\n // this.$emit(\"add-tab\", params);\n }\n }else if(jumpType === 'jumpto'){\n if (openType == \"open-eject\" || openType == \"dialog\") {\n let type = \"JUMP\";\n this.$parent.openDialogJump(params,type);\n }else if (openType == \"open-present\") {\n this.$emit(\"openNewpage\",params)\n }else if (openType == \"open-blank\"){\n let routeData = this.$router.resolve({\n name: \"view_blank\",\n query: params,\n });\n window.open(routeData.href, \"_blank\");\n }else {//默认用tab方式打开\n // this.$emit(\"add-tab\", params);\n this.addTab(params)\n }\n }\n },\n\n //删除或导入数据后重新请求加载数据\n reloadListView(){\n // this.reloadListViewRandom = new Date().getTime();\n // this.getData(this.currentPage, this.pagesize, this.searchExcelData);\n },\n\n buttonClick(){\n\n },\n\n /*\n * 脚本,o-action\n */\n template(val) {\n return {\n methods: {\n calctextJump: this.calctextJump,\n },\n template: \"
\"+val+\"
\"\n };\n },\n \n downloadFile(file){ //列表文件下载\n let url = file.url;\n let link = document.createElement('a')\n link.style.display = 'none'\n link.href = obpmConfig.obpmFilePath + \n \"/runtime/file/download?filename=\"+ file.name +\n \"&filepath=\" + file.path;\n link.setAttribute('download', file.name);\n link.click();\n },\n\n handlePreview(file) {\n\t\t\tthis.$api.getenvironment(\n\t\t\t\t{\n\t\t\t\t\tonSucess: res => {\n\t\t\t\t\t\tif(res.data.errcode === 0) {\n\t\t\t\t\t\t\tif(res.data.data === true) {\n\t\t\t\t\t\t\t\tlet realName = file.path.split(\"/\")[file.path.split(\"/\").length - 1];\n\t\t\t\t\t\t\t\tlet isEdit = 'edit';\n\t\t\t\t\t\t\t\tlet waterMark = '';\n\t\t\t\t\t\t\t\tlet openWaterMark = false;\n\t\t\t\t\t\t\t\tlet curEditUserId = this.$store.state.myProfile.id;\n\t\t\t\t\t\t\t\tlet userName = this.$store.state.myProfile.name;\n\t\t\t\t\t\t\t\tlet showTrackRevisions = false;\n\t\t\t\t\t\t\t\tlet selectEditPlug = 'tray';\n let cp = obpmConfig.obpmFilePath;\n sessionStorage.setItem(\"obpmContextPath\", cp);\n let statiContextPath = obpmConfig.statiContextPath;\n let pdfPath = \"\";\n if(statiContextPath) { //5.0 trunk\n pdfPath = obpmConfig.statiContextPath;\n }else { //4.4 stable\n pdfPath = cp;\n }\n\t\t\t\t\t\t\t\tlet url = pdfPath + \"/portal/good/html/pdfviewer.html?action=\" + isEdit + \n\t\t\t\t\t\t\t\t\t\t\"&path=\" + file.path + \n\t\t\t\t\t\t\t\t\t\t\"&name=\" + realName + \n\t\t\t\t\t\t\t\t\t\t\"&showName=\" + file.name + \n\t\t\t\t\t\t\t\t\t\t\"&waterMark=\" + waterMark + \n\t\t\t\t\t\t\t\t\t\t\"&openWaterMark=\" + openWaterMark +\n\t\t\t\t\t\t\t\t\t\t\"&curEditUserId=\" + curEditUserId +\n\t\t\t\t\t\t\t\t\t\t\"&userName=\" + userName + \n\t\t\t\t\t\t\t\t\t\t\"&showTrackRevisions=\" + showTrackRevisions +\n\t\t\t\t\t\t\t\t\t\t\"&selectEditPlug=\" + selectEditPlug;\n\t\t\t\t\t\t\t\t\t\tlet URL = encodeURI(url)\n\t\t\t\t\t\t\t\t\t\twindow.open(URL);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t},\n\n load(tree, treeNode, resolve) {\n let that = this;\n let appId = this.openParams.appId;\n let params = {\n viewId: this.openParams.actionContent,\n opentarget: 'detail',\n containTitle: this.view.name,\n }\n this.$api.getCollapsedviewTemplate(\n appId,\n params,\n {\n onSucess: res => {\n if(res.data.data) {\n that.$api.getViewData(\n //普通视图接口\n that.$root.appid,\n that.openParams.actionContent,\n {\n currpage: that.currentPage,\n lines: 10,\n parentParam: encodeURIComponent(tree.parentName + '\\\\'),\n },\n {},\n {\n onSucess: response => {\n let docs = response.data.data.data;\n let tds = [];\n if (docs) {\n docs.forEach(doc => {\n let rows = {};\n rows.formId = doc.formId;\n rows.docId = doc.id;\n for (let key in doc.items) {\n let items = doc.items[key];\n rows[key] = items.value;\n }\n if(doc.hasChild) {\n rows.hasChildren = true;\n }\n if(doc.parentName) {\n rows.parentName = doc.parentName;\n }\n tds.push(rows);\n });\n console.log(tds)\n resolve(tds);\n } \n }\n }\n );\n }\n }\n }\n )\n },\n \n regReplace(value){\n if(value){\n return value.replace(/%/g, \"%\")\n }\n },\n\n reloadListView(){\n this.getData(this.currentPage);\n },\n\n onRowClick(row) {\n let params = {\n linkType: \"00\",\n name: this.view.name,\n appId: this.openParams.appId,\n actionContent: row.formId,\n _select:row.docId,\n viewId: this.view.id,\n parentId:this.openParams.parentId?this.openParams.parentId:'', //包含元素时判断是否有parentId\n isRelate:this.openParams.isRelate?this.openParams.isRelate:'', //包含元素时判断isRelate是否为true\n templateForm:this.view.templateForm?this.view.templateForm:'',\n };\n if(this.showtype == 'include'){\n this.toTab(params);\n }else {\n this.$emit(\"add-tab\", params)\n }\n //this.$emit(\"openNewpage\",params); //打开新页面\n \n },\n\n handleSelectionChange(val) {\n // debugger\n let docIds = [];\n if(val.length>0) {\n for(let i=0; i {\n let docs = response.data.data;\n this.dataList = response.data.data;\n this.row_count = response.data.row_count;\n let tds = [];\n this.$emit(\"hiddenLoading\");\n if (docs) {\n docs.forEach(doc => {\n let rows = {};\n rows.formId = doc.formId;\n rows.docId = doc.id;\n for (var key in doc.items) {\n let items = doc.items[key];\n rows[key] = items.value;\n }\n if(doc.hasChild) {\n rows.hasChildren = true;\n }\n if(doc.parentName) {\n rows.parentName = doc.parentName;\n }\n tds.push(rows);\n });\n if(tds.length == 0){\n this.emptyData = this.$t('nodata')\n }\n this.loading = false;\n this.tableData = tds;\n } \n });\n },\n \n //模拟数据请求\n getViewData(page, searchData) {\n let openParams = this.openParams;\n let treeData = \"\";\n let treeName = \"\";\n if (this.parentId) {\n //树形视图\n return new Promise(resolve => {\n this.$api.getTreeViewData(\n //树形视接口\n this.openParams.appId,\n this.openParams.actionContent,\n {\n parentId: this.parentId ? this.parentId : \"\"\n },\n treeData,\n treeName,\n {\n onSucess: response => {\n let treeViewData = response.data;\n resolve(treeViewData);\n }\n }\n );\n });\n } else if (this.openParams && this.openParams.parentId) {\n //包含元素时\n return new Promise(resolve => {\n searchData = searchData || {}\n this.$api.getViewData(\n //普通视图接口\n this.openParams.appId,\n this.view.id,\n {\n parentId: this.openParams.parentId,\n isRelate: this.openParams.isRelate,\n currpage: page?page:this.currentPage,\n lines: this.view.data ? this.view.data.page_lines : 10,\n searchWord: ''\n },\n searchData ? searchData : {},\n {\n onSucess: response => {\n let viewData = response.data;\n resolve(viewData);\n }\n }\n );\n });\n } else {\n return new Promise(resolve => {\n searchData = searchData || {};\n if(openParams.queryString) {\n searchData = this.setParams(openParams.queryString, searchData)\n }\n let urlParams = openParams.urlParams;\n if(urlParams) {\n searchData = this.setParams(urlParams, searchData)\n }\n if(openParams.exparams) {\n searchData = this.setParams(openParams.exparams, searchData)\n }\n this.$api.getViewData(\n //普通视图接口\n this.openParams.appId,\n this.view.id,\n {\n parentId: this.parentId ? this.parentId : \"\",\n currpage: page?page:this.currentPage,\n lines: this.view.data ? this.view.data.page_lines : 10,\n searchWord:'',\n },\n searchData ? searchData : {},\n {\n onSucess: response => {\n let viewData = response.data;\n resolve(viewData);\n }\n }\n );\n });\n }\n },\n\n setParams(params, obj){\n params = params.replace(/^(\\s|&)+|(\\s|&)+$/g, '')\n let list = params.split(\"&\")\n for (let i = 0; i < list.length; i++) {\n let p = list[i].split(\"=\")\n let isJson = this.isJSON(p[1])\n if(isJson) {\n obj[p[0]] = encodeURI(p[1])//encodeURIComponent(p[1])\n }else {\n obj[p[0]] = p[1]?p[1]:''\n }\n }\n return obj\n },\n\n isJSON(str) { //判断是json字符串\n if (typeof str == 'string') {\n try {\n let obj=JSON.parse(str);\n if(typeof obj == 'object' && obj ){\n return true;\n }else{\n return false;\n }\n } catch(e) {\n return false;\n }\n }\n },\n\n viewFieldPath(value, field) {\n if (value && field == \"ImageUploadField\") {\n return obpmConfig.obpmFilePath + value.path;\n } else if (value && field == \"AttachmentUploadField\") {\n let arr = JSON.parse(value);\n return arr;\n }\n },\n\n /*number 需要保留小数的数\n fractionDigits 保留小数位数\n */\n toFixed(number, fractionDigits) {\n let times = Math.pow(10, fractionDigits);\n let roundNum = Math.round(number * times) / times;\n let currentVal = roundNum.toFixed(fractionDigits);\n if (fractionDigits == \"5\") {\n let num = (roundNum || 0).toString();\n let result = \"\";\n while (num.length > 3) {\n result = \",\" + num.slice(-3) + result;\n num = num.slice(0, num.length - 3);\n }\n if (result) {\n result = num + result + \".\" + currentVal.split(\".\")[1];\n return result;\n } else {\n return currentVal;\n }\n } else {\n return currentVal;\n }\n },\n /* number:要格式化的数字\n * decimals:保留几位小数 默认0位\n * currency:货币类型\n * decPoint:小数点符号 默认.\n * thousandsSep:千分位符号 默认为,\n */\n currencyChange(\n number,\n decimals,\n currency,\n decPoint = \".\",\n thousandsSep = \",\"\n ) {\n number = (number + \"\").replace(/[^0-9+-Ee.]/g, \"\");\n let n = !isFinite(+number) ? 0 : +number;\n let prec = !isFinite(+decimals) ? 0 : Math.abs(decimals);\n let sep = typeof thousandsSep === \"undefined\" ? \",\" : thousandsSep;\n let dec = typeof decPoint === \"undefined\" ? \".\" : decPoint;\n let s = \"\";\n let symbol;\n if (currency == \"zh_CN\") {\n symbol = \"¥\";\n } else if (currency == \"en_US\") {\n symbol = \"$\";\n } else if (currency == \"en_GB\") {\n symbol = \"£\";\n } else if (currency == \"ja_JP\") {\n symbol = \"¥\";\n } else {\n symbol = \"\";\n }\n let toFixedFix = function (n, prec) {\n let k = Math.pow(10, prec);\n return \"\" + Math.ceil(n * k) / k;\n };\n s = (prec ? toFixedFix(n, prec) : \"\" + Math.round(n)).split(\".\");\n let re = /(-?\\d+)(\\d{3})/;\n while (re.test(s[0])) {\n s[0] = s[0].replace(re, \"$1\" + sep + \"$2\");\n }\n if ((s[1] || \"\").length < prec) {\n s[1] = s[1] || \"\";\n s[1] += new Array(prec - s[1].length + 1).join(\"0\");\n }\n return symbol + s.join(dec);\n },\n\n },\n};\n",null]}