{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/view_delegate.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/src/components/view_delegate.vue","mtime":1740130327259},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-mobile/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 view_emptyview from \"@/components/view_emptyview.vue\";\nimport view_listview from \"@/components/view_listview.vue\";\nimport view_treeview from \"@/components/view_treeview.vue\";\nimport view_gridview from \"@/components/view_gridview.vue\";\nimport view_mapview from \"@/components/view_mapview.vue\";\nimport form_searchform from \"@/components/form_searchform.vue\";\nimport view_calendarview from \"@/components/view_calendarview.vue\";\nimport activity from \"@/components/activity.vue\";\nimport { MessageBox } from 'mint-ui';\nimport { Toast } from 'mint-ui';\nimport comm_dialog from \"@/components/comm_dialog.vue\";\nimport bulksubmission_panel from \"@/components/bulksubmission_panel.vue\";\nimport { Indicator } from 'mint-ui';\nimport form_normalform from \"@/components/form_normalform.vue\";\nexport default {\n inject: ['reload'],\n name: \"view-delegate\",\n props: [\n \"openParams\", \n \"clearCheckboxVal\", \n \"showtype\", //包含元素\n \"isView\", //是否是视图\n \"parentId\", //树形视图的parentId\n \"searchdata\",\n \"viewDialogName\",\n \"includeDisplayType\" //包含元素为只读时的displayType=1,=4\n ],\n created: function() {\n if(this.openParams.isWidgetChartView) {\n this.view = this.$store.state.widgetChartViewData;\n }else {\n this.initView({\n appId: this.openParams.appId,\n viewId: this.openParams.actionContent\n });\n }\n\n },\n watch: {\n '$route' () { //监听路由是否变化\n },\n showMore() {\n if(!this.showMore) {\n let columnsArray = {\n id: this.openParams.actionContent, \n columns: this.newColumns,\n }\n let list = JSON.parse(localStorage.getItem(\"columnsArray\") || '[]');\n let res = list.some(item=>{\n if(item.id == columnsArray.id){\n return true\n }\n })\n if(res){ \n for(let i=0; i (this.isRouterAliveInclude = true));\n }, \n\n checkboxVal(val) {\n this.selectedDocIds = val;\n let viewcomp = this.$refs['viewcomp']\n if(this.selectedDocIds.length>=viewcomp.documents.length){\n this.allChecked = true\n }else{\n this.allChecked = false\n this.checkedState ='state' //全选中间按钮状态,什么动作也不执行\n }\n },\n //获取树的个数\n \n getData(data){\n this.dataList = data;\n },\n\n //全选\n onChange() {\n if(this.allChecked==true){\n this.checkedState = true\n }else if(this.allChecked==false){\n this.checkedState = false\n }\n },\n\n //全选获取数据\n getAllVal(value) {\n this.selectedDocIds = value;\n this.documents = value;\n },\n\n //包含元素从view_listView打开表单\n toNormalform(params) {\n params.isIncludeCreate = \"include\";\n this.newIncludeO = params;\n this.newInclude = false;\n },\n\n //展示数据列表\n listviewList(val) {\n this.$emit(\"refreshForm\");\n this.isFormToView = val;\n this.newInclude = true;\n },\n \n //创建\n doCreate(act) {\n let appId = this.$root.appid;\n let openParams = this.openParams;\n let view = this.view;\n //以下的参数形式是在新建后执行执行后脚本(参考pc端)\n let formData = {\n docId: \"\",\n document: {},\n formId: view.relatedForm,\n parentId: \"\",\n templateForm: \"\",\n viewId: openParams.actionContent,\n _selects: this.selectedDocIds,\n }\n let divId = act.id;\n let docId = '';\n let parentId = '';\n let _templateForm = '';\n let _ = '';\n let runAfterParams = {\n appId,\n divId,\n docId,\n actionContent: openParams.actionContent,\n relatedForm: view.relatedForm,\n _templateForm,\n parentId,\n _,\n formData,\n }\n\n this.$api.hasPermissionToForm(appId, act.onActionForm, {\n onSucess: response => {\n if(response.data.data) {\n let _r = JSON.stringify(runAfterParams);\n let obj = {\n linkType: \"00\",\n appId: this.$root.appid,\n actionContent: act.onActionForm,\n newDoc: true,\n parentId: openParams.parentId ? openParams.parentId:'', //包含元素时判断是否有parentId\n isRelate: openParams.isRelate ? openParams.isRelate:'', //包含元素时判断isRelate是否为true\n showtype: openParams.showtype,\n formId: openParams.formId,\n viewId: openParams.actionContent,\n isNewCreate: true,\n runAfterParams : encodeURI(_r),\n };\n\n let params = {\n linkType: \"00\",\n appId: this.$root.appid,\n actionContent: act.onActionForm,\n parentId: openParams.parentId ? openParams.parentId:'', //包含元素时判断是否有parentId\n isRelate: openParams.isRelate ? openParams.isRelate:'', \n isIncludeCreate: \"include\",\n isNewCreate: true,\n runAfterParams : encodeURI(_r),\n };\n if(this.showtype == 'include') {\n this.newIncludeO = params;\n this.newInclude = false;\n }else if(this.showtype == 'tab'){\n params.isIncludeCreate = 'tab';\n this.newIncludeO = params;\n this.newInclude = false;\n }else {\n this.$router.push({ name: \"open\", query: obj })\n }\n }else {\n Toast(this.$t('notPermission'))\n }\n }\n })\n // let obj = {\n // linkType: \"00\",\n // appId: this.$root.appid,\n // actionContent: act.onActionForm,\n // newDoc: true\n // };\n\n // this.$emit(\"onAction\", obj, this.showtype);\n },\n\n //跳转按钮的跳转类型\n jumpType(act){\n let dispatcherParams = '';\n let _op = this.openParams;\n if(act && act.dispatcherParams) { //如果按钮这个参数存在值,那么在新建表单或者打开表单时得把值传到后台\n dispatcherParams = act.dispatcherParams; \n }\n let name = this.view.fullName.split(\"_\").join(\"、\")\n let obj = {\n docId: '',\n appId: _op.appId,\n viewId: act.parentView, \n opentarget: '',\n containTitle:name,\n field:'',\n isRelate: undefined,\n parentId:'',\n \n };\n let selectDocIds = this.selectedDocIds;\n let _selects = ''\n if(selectDocIds && selectDocIds.length > 0) {\n _selects = selectDocIds.join(\";\");\n obj._selects = _selects;\n }\n if(_op.parentId) {\n obj.parentId = _op.parentId;\n }\n obj.isRelate = _op.isRelate;\n this.$api.getAxecuteAddress(\n _op.appId,\n act.id,\n obj,\n {\n onSucess: res => {\n if(res.data.errcode === 0) {\n let url = res.data.data.content;\n let isForm = url.search(\"form.html\") != -1;\n let isView = url.search(\"view.html\") != -1;\n let urlArrayF = url.split(\"?\");\n let urlArray = '';\n if(urlArrayF[1]) {\n urlArray = urlArrayF[1].split(\"&\");\n }\n this.isJumpForm = isForm;\n this.isJumpView = isView;\n let type = '';\n let isExternalLink = false;\n if(isForm) {\n type = '00';\n }else if(isView) {\n type = \"01\"\n }else if (!isForm && !isView) {\n isExternalLink = true;\n this.isExternalLink = true; //判断是否是外部链接\n }\n let params = {\n linkType: type,\n appId: _op.appId,\n actionContent: '',\n name: act.name,\n _select: '',\n viewId: \"\",\n };\n let obj = {};\n if(urlArray && urlArray.length > 0) {\n for(let i=0; i {\n params[item.paramKey] = item.paramValue;\n });\n }\n if(this.showtype == 'include') {\n params.isIncludeCreate = \"include\"\n this.newIncludeO = params;\n this.newInclude = false;\n }else if(this.showtype == 'tab'){\n params.isIncludeCreate = 'tab';\n this.newIncludeO = params;\n this.newInclude = false;\n }else {\n this.$router.push({ name: \"open\", query: params });\n }\n // this.$emit(\"openNewpage\",params)\n }else {\n params.linkType = '103';\n params.actionContent = url;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n this.$router.push({ name: \"open\", query: params });\n }\n break;\n case 1:\n if(!isExternalLink) {\n params.actionContent = obj.viewId ? obj.viewId : obj.formId;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n if(this.showtype == 'include') {\n params.isIncludeCreate = \"include\"\n this.newIncludeO = params;\n this.newInclude = false;\n }else if(this.showtype == 'tab'){\n params.isIncludeCreate = 'tab';\n this.newIncludeO = params;\n this.newInclude = false;\n }else {\n this.$router.push({ name: \"open\", query: params });\n }\n // this.$router.push({ name: \"open\", query: params });\n }else {\n params.linkType = '103';\n params.actionContent = url;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n this.$router.push({ name: \"open\", query: params });\n // window.location = url;\n }\n break;\n case 2:\n if(!isExternalLink) {\n params.actionContent = obj.viewId ? obj.viewId : obj.formId;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n if(this.showtype == 'include') {\n params.isIncludeCreate = \"include\"\n this.newIncludeO = params;\n this.newInclude = false;\n }else if(this.showtype == 'tab'){\n params.isIncludeCreate = 'tab';\n this.newIncludeO = params;\n this.newInclude = false;\n }else {\n this.$router.push({ name: \"open\", query: params });\n }\n // this.$router.push({ name: \"open\", query: params });\n }else {\n params.linkType = '103';\n params.actionContent = url;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n this.$router.push({ name: \"open\", query: params });\n // window.location = url;\n }\n break;\n case 3:\n if(!isExternalLink) {\n params.actionContent = obj.viewId ? obj.viewId : obj.formId;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n if(this.showtype == 'include') {\n params.isIncludeCreate = \"include\"\n this.newIncludeO = params;\n this.newInclude = false;\n }else if(this.showtype == 'tab'){\n params.isIncludeCreate = 'tab';\n this.newIncludeO = params;\n this.newInclude = false;\n }else {\n this.$router.push({ name: \"open\", query: params });\n }\n } else {\n params.linkType = '103';\n params.actionContent = url;\n params.clearTemp = obj.clearTemp ? obj.clearTemp : '';\n if(dispatcherParams) {\n let dp = JSON.parse(dispatcherParams);\n dp.forEach(item => {\n params[item.paramKey] = item.paramValue;\n });\n }\n this.$router.push({ name: \"open\", query: params });\n }\n break;\n case 4:\n break;\n default:\n break;\n }\n }\n }\n }\n )\n },\n\n //包含元素和选项卡下o-action跳转\n onHandlerOaction(params){\n let _op = this.openParams;\n params.appId = _op.appId;\n params.isIncludeCreate = \"include\"\n this.newIncludeO = params;\n this.newInclude = false; \n },\n \n //删除\n doRemove(act) {\n let docIds = this.selectedDocIds;\n if(docIds.length < 1) {\n Toast('请选择至少一条数据');\n }else {\n MessageBox.confirm('', {\n title:this.$t('tip'),\n message:`是否需删除${docIds.length}条数据`,\n confirmButtonText:this.$t('confirm'),\n cancelButtonText: this.$t('cancel')\n }).then(() => { \n this.runBeforeAction(act, docIds);\n }).catch(() =>{\n });\n }\n },\n\n //返回\n doBack() {\n // 这里触发返回 需要判断 走app 还是走h5 历史栈\n if(this.$route.query.from === 'app'){\n this.$JsBridge.postToApp(\"goBack\");\n return \n }\n this.newInclude = true;\n Indicator.close();\n if (this.$parent.close) {\n //this.$parent.closeDialog();\n //this.$emit(\"event\"); //包含元素的closeDialog方法等\n this.$parent.$parent.$parent.closeDialog();\n } else {\n this.$parent.doBack();\n }\n },\n\n onSearchBtnClick() {\n this.popupVisible = !this.popupVisible;\n },\n\n removeDocuments(act,docIds){\n this.$api.batchRemoveDocuments(this.$root.appid, docIds, {\n onSucess: () => {\n //直接删除数据即可\n let _st = this.showtype;\n if((_st && _st == 'include') || (_st && _st == 'tab')) {\n this.includeReload();\n }else {\n Toast({\n message: \"删除成功\",\n iconClass: 'fa fa-check fa-2x'\n });\n this.runAfterAction(act, [])\n this.reload();\n }\n \n this.allChecked = false;\n this.selectedDocIds = [];\n }\n });\n },\n \n //执行脚本前\n /**\n * docIds 视图选中的id\n * **/\n runBeforeAction(act, docIds){\n if(act && act.dispatcherParams) { //如果按钮这个参数存在值,那么在新建表单或者打开表单时得把值传到后台\n this.dispatcherParams = act.dispatcherParams; \n }\n let openParams = this.openParams;\n let formData = {\n docId: \"\",\n document: {},\n formId: this.view.relatedForm,\n parentId: \"\",\n templateForm: this.view.templateForm,\n viewId: openParams.actionContent,\n _selects: this.selectedDocIds?this.selectedDocIds:[],\n }\n if(openParams.isRelate) {\n formData.isRelate = openParams.isRelate;\n }\n if(openParams.parentId) {\n formData.parentId = openParams.parentId;\n }\n let divId = act.id;\n this.$api.runBeforeActionScript(this.$root.appid, divId, formData, {\n onSucess: response => {\n if(response.data.data) {\n let resData = response.data.data;\n let errmsg = resData.content;\n if(resData.changedField) {\n Toast({\n message: errmsg,\n iconClass: 'icon icon-success'\n });\n }else {\n if(resData.type && resData.type === 1) {\n Toast({\n message: errmsg,\n iconClass: 'icon icon-success'\n });\n }else if(resData.type && resData.type === 16) {\n Toast(errmsg);\n }else if(resData.type && resData.type === 32) {\n MessageBox.confirm('', {\n title:this.$t('tip'),\n message:errmsg,\n confirmButtonText:this.$t('confirm'),\n cancelButtonText: this.$t('cancel')\n }).then(() => { \n switch (act.type) {\n case 2: \n this.doCreate(act);\n break;\n case 3: //删除\n this.removeDocuments(act,docIds);\n break;\n case 18:\n this.clearAllData(act);\n break;\n case 43: \n this.jumpType(act);\n break;\n default:\n break;\n }\n }).catch(() =>{\n });\n }else {\n Toast(errmsg);\n }\n }\n }else {\n switch(act.type) {\n case 1:\n this.getTemplate(act);\n break;\n case 2: //新建\n this.doCreate(act);\n break;\n case 3: //删除\n this.removeDocuments(act,docIds);\n break;\n case 18:\n this.clearAllData(act);\n break;\n case 43: //跳转\n this.jumpType(act);\n break;\n default:\n this.getTemplate(act);\n break;\n }\n }\n }\n });\n },\n\n //执行脚本后\n runAfterAction(act, docIds) {\n let sd = this.searchdata;\n let op = this.openParams;\n let view = this.view;\n let formData = {\n docId: \"\",\n document: sd ? sd : {},\n formId: view.relatedForm,\n parentId: \"\",\n templateForm: \"\",\n viewId: op.actionContent,\n _selects: docIds && docIds.length > 0 ? docIds : this.selectedDocIds,\n }\n let appId = op.appId;\n let divId = act.id;\n let docId = '';\n let parentId = '';\n let _templateForm = '';\n let _ = '';\n this.$api.runAfterActionScript(\n appId,\n divId,\n docId,\n op.actionContent,\n view.relatedForm,\n _templateForm,\n parentId,\n _,\n formData,\n act.type,//act.type\n {\n onSucess: response => {\n if(response.data.data){\n let returnData = response.data.data;\n if(returnData.changedField) {\n Toast({\n message: returnData.content,\n iconClass: 'icon icon-success'\n });\n }else {\n let errmsg = response.data.data.content;\n if(returnData.type && returnData.type == 'message') {\n if(errmsg.type == 16) {\n Toast({\n message: errmsg.content,\n iconClass: 'icon icon-success'\n });\n }\n }else if(returnData.type && returnData.type == '1') {\n Toast({\n message: errmsg,\n iconClass: 'icon icon-success'\n });\n }else {\n Toast({\n message: errmsg,\n iconClass: 'icon icon-error'\n });\n }\n }\n }else {\n //this.reload();执行脚本后刷新会让载入视图加载成当前视图,而不是目标视图\n // this.$refs.viewcomp.getData();\n }\n }\n }\n );\n },\n\n clearAllData(act){\n let that = this;\n MessageBox.confirm('', {\n title:this.$t('tip'),\n message:`是否需删除所有数据`,\n confirmButtonText:this.$t('confirm'),\n cancelButtonText: this.$t('cancel')\n }).then(() => { \n this.$api.deleteAllData(this.$root.appid, this.view.relatedForm, {\n onSucess: (res) => {\n //直接删除数据即可\n if(res.data.errcode == 0) {\n if(this.showtype && this.showtype == 'include') {\n that.includeReload();\n }else {\n Toast({\n message: res.data.data,\n iconClass: 'fa fa-check fa-2x'\n });\n that.runAfterAction(act,[]);\n that.reload();\n }\n this.allChecked = false;\n this.selectedDocIds = [];\n }\n }\n });\n }).catch(() =>{\n });\n },\n\n getTemplate(act){\n // this.view = '';\n let appId = this.$root.appid;\n let viewId = act.onActionView;\n let exparams = \"\";\n this.$api.getViewTemplate(appId, viewId, exparams, {\n onSucess: response => {\n if(response.data.errcode == 0){\n let view = JSON.parse(JSON.stringify(response.data.data));\n this.title = response.data.data.description || response.data.data.name;\n let columnsArray = response.data.data.columns;\n for(let i=0;i { //视图有标签时,把列抽出来\n if(column.showAsLabel) {\n viewLabelArray.push(column);\n }\n })\n if(viewLabelArray.length > 0){\n view.viewLabelArray = viewLabelArray;\n }\n let viewButtonArray = [];\n columnsArray.forEach(column => { //视图有标签时,把列抽出来\n if(column.showAsButton) {\n viewButtonArray.push(column);\n }\n })\n if(viewButtonArray.length > 0){\n view.viewButtonArray = viewButtonArray;\n }\n this.view = view;\n let list = JSON.parse(localStorage.getItem(\"columnsArray\") || '[]'); //columnsArray为选择视图显示多少列\n let currentViewList = [];\n let res = list.some(item=>{\n if(item.id == view.id){\n currentViewList.push(item);\n return true\n }\n })\n if(res){ \n let showColumns = [];\n for(let i=0; i\",this.view)\n // console.log(\"res.data.data>\",response.data.data)\n this.runAfterAction(act, []);\n }\n }\n })\n },\n\n onAction(act) {\n //绑定视图的处理事件\n let activityType = act.type;\n switch (act.type) {\n case 1: //载入视图\n this.runBeforeAction(act);\n break;\n case 2: //创建\n this.runBeforeAction(act);\n break;\n case 3: //删除\n this.doRemove(act);\n break;\n case 4: //保存并启动流程\n break;\n case 5: //流程处理\n this.$parent.flowHandle();\n break;\n case 8: //关闭窗口\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 10: //返回\n this.doBack();\n //this.$parent.goBack();\n break;\n case 11: //保存并返回\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 14: //网页打印(表单)\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 15: //网页打印含历史\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 19: //保存草稿不校检\n //this.$parent.saveDraft();\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 18: //清空所有数据\n this.runBeforeAction(act);\n break;\n case 20: //批量提交\n this.showSubmitPanel(act);\n break;\n case 21: //保存并复制\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 25: //PDF导出\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 26: //文件下载\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 28: //电子签章\n break;\n case 29: //批量签章\n break;\n case 33: //流程启动\n break;\n case 34: //保存\n //this.$parent.doSave();\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 42: //保存并新建\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 43: //跳转\n this.runBeforeAction(act);\n break;\n case 45: //归档\n this.$parent.runBeforeAction(act.id, \"\", \"\", activityType);\n break;\n case 46: //签章\n break;\n default:\n break;\n }\n },\n\n getSelectedDocs(mapping) {\n let mappingValues = [];\n this.selectedDocIds.forEach(id => {\n if (this.view && this.view.data) {\n this.view.data.data.forEach(doc => {\n if (id == doc.id) {\n let mval = { docid: doc.id, data: [] };\n mapping.forEach(map => {\n let item = { fieldName: map.value, fieldValue: \"\" };\n this.view.columns.forEach(clm => {\n if (clm.id == map.id) {\n item.fieldValue = doc.items[clm.id].value;\n }\n });\n mval.data.push(item);\n });\n\n mappingValues.push(mval);\n }\n });\n }\n });\n return mappingValues;\n },\n\n onSearch(searchData) {\n console.log(\"searchData\",searchData)\n this.searchData = searchData;\n this.searchViewData = {};\n this.openParams.searchdata = {};\n this.showSearchDialog = false;\n this.popupVisible = false;\n },\n\n buildSearchData() {\n return this.$refs.searchform.buildSearchData();\n },\n\n //获取后台template返回的数据\n initView({ appId, viewId}) {\n let openParams = this.openParams;\n if(this.parentId) { \n //树形视图时\n this.$api.getViewTemplateP(appId, viewId, this.parentId, {\n onSucess: response => {\n if (response.data.data) {\n this.view = response.data.data;\n this.title =\n response.data.data.description || response.data.data.name;\n }\n }\n });\n }else if((openParams && openParams.parentId)) { //包含元素时或试图选择框时\n console.log(appId)\n console.log(viewId)\n console.log(this.openParams.parentId)\n console.log(this.openParams.isRelate)\n this.$api.getViewTemplateInclude(appId, viewId, this.openParams.parentId, this.openParams.isRelate, {\n onSucess: response => {\n console.log(\"response\",response);\n if (response.data.data) {\n let includeViewData = response.data.data;\n // this.view = response.data.data;\n if(this.includeDisplayType && (this.includeDisplayType === 4 || this.includeDisplayType === 1)) { //包含元素为只读或者不可用时,隐藏删除和新建按钮\n let btns = includeViewData.activities;\n if(btns) {\n if(btns.length > 0) {\n for(let i=0; i{\n if(item.id == this.openParams.actionContent){\n currentViewList.push(item);\n return true\n }\n })\n if(res){ \n let showColumns = [];\n for(let i=0; i {\n obj[item['paramKey']] = item['paramValue'];\n });\n }\n this.$api.getViewTemplate(appId, viewId, obj, {\n onSucess: response => {\n if (response.data.data) {\n let view = response.data.data;\n this.title = response.data.data.description || response.data.data.name;\n let columnsArray = response.data.data.columns;\n for(let i=0;i { //视图有标签时,把列抽出来\n if(column.showAsLabel) {\n viewLabelArray.push(column);\n }\n })\n if(viewLabelArray.length > 0){\n view.viewLabelArray = viewLabelArray;\n }\n let viewButtonArray = [];\n columnsArray.forEach(column => { //视图有标签时,把列抽出来\n if(column.showAsButton) {\n viewButtonArray.push(column);\n }\n })\n if(viewButtonArray.length > 0){\n view.viewButtonArray = viewButtonArray;\n }\n this.view = view;\n let list = JSON.parse(localStorage.getItem(\"columnsArray\") || '[]');\n let currentViewList = [];\n let res = list.some(item=>{\n if(item.id == this.openParams.actionContent){\n currentViewList.push(item);\n return true\n }\n })\n if(res){ \n let showColumns = [];\n for(let i=0; i