angular.module('push') .controller('resourceCommonDetailsPageCtrl', function ($scope, $rootScope, $timeout, $state, $ionicPopup, $stateParams, $ionicScrollDelegate, $ionicActionSheet, $ionicSlideBoxDelegate, ResourceLibraryService, taskModuleService, CommentService, UserService, UtilService, ConstantService, ShareService, AccountService, dataToolsService, CommonService, ConfigService, $q, $ionicModal, statisticsReportService, $ionicHistory) { //TODO // 传入参数 //1:需求,2:成果,6:企业,7:高校,8:人才 $scope.showInterview = $stateParams.restype == '6'; console.log('params', $stateParams) $scope.node = UserService.node; $scope.privateName = $stateParams.privateName $scope.defaultLan = UserService.defaultLan; //当前登陆人员是否是桐庐节点管理人员 ResourceLibraryService.judgeManager(UserService.id, 0).then(function (res) { $scope.hasAuth = res.data $scope.showMonthReport = res.data && ($stateParams.recourcetype == "6"); }) // $scope.showManagmentSheet = function () { // $scope.go("exportField", { "reslist": $stateParams.row }); // } //仅限节点人员和节点运营人员可操作,可为当前资源增设标签 taskModuleService.getUserPermissionCheck($stateParams.recourceid, $stateParams.creator, UserService.id).then(function (res) { if (res.code == 3350) { $scope.canAddLabel = res.data; } }) //获取企业年报数据 ResourceLibraryService.getYearReport($stateParams.title).then(function (res) { if (res.code == 3350) { $scope.datalist = res.data; } }) //点击加号,添加标签 $scope.label = {}; $scope.addLabel = function () { //权限判断(仅限节点人员和节点运营人员方可进行资源库自定义标签添加) taskModuleService.thisUserIsAdmin().then(function (res) { if (res.code == 3350 && res.data == true) { var ionicDialog = $ionicPopup.confirm({ template: '', title: '请输入自定义标签', scope: $scope, okText: '确定', cancelText: '取消' }); ionicDialog.then(function (result) { if (result) { if ($scope.label.name != null && $scope.label.name != undefined && $scope.label.name.trim() != "") { ResourceLibraryService.addLabelToDB($stateParams.recourceid, $scope.label.name).then(function (res) { if (res.code == 3350) { if (res.data == true) { //添加成功 $ionicPopup.alert({ title: '提示', template: '添加标签成功!' }); $state.reload(); } if (res.data == false) { //添加失败 $ionicPopup.alert({ title: '提示', template: '标签已存在,添加失败!' }); } } $scope.label = {}; } ) } else { $ionicPopup.alert({ title: '提示', template: '请输入标签' }); return; } } }) } else { ResourceLibraryService.judgeManager(UserService.id, 10501).then(function (response) { if (response.code == 3350 && response.data == true) { var ionicDialog = $ionicPopup.confirm({ template: '', title: '请输入自定义标签', scope: $scope, okText: '确定', cancelText: '取消' }); ionicDialog.then(function (result) { if (result) { if ($scope.label.name != null && $scope.label.name != undefined && $scope.label.name.trim() != "") { ResourceLibraryService.addLabelToDB($stateParams.recourceid, $scope.label.name).then(function (res) { if (res.code == 3350) { if (res.data == true) { //添加成功 $ionicPopup.alert({ title: '提示', template: '添加标签成功!' }); $state.reload(); } if (res.data == false) { //添加失败 $ionicPopup.alert({ title: '提示', template: '标签已存在,添加失败!' }); } } $scope.label = {}; } ) } else { $ionicPopup.alert({ title: '提示', template: '请输入标签' }); return; } } }) } else { $ionicPopup.alert({ title: '提示', template: '仅限节点人员和节点运营人员方可进行标签添加功能' }) return; } }) } }) } $scope.searchtype = 2; $scope.allLabel = []; $scope.showCollapse = { label: false, showMore: false }; // $scope.showMoreLabel = function () { // $scope.showCollapse.showMore = !$scope.showCollapse.showMore; // if ($scope.showCollapse.showMore) { // $scope.label = $scope.allLabel.slice(0, 3); // } else { // $scope.label = $scope.allLabel; // } // } // 按标签查询页面 var labelResourceListModal = function () { $ionicModal.fromTemplateUrl('./modules/common/views/labelResourceListModal.html', { scope: $scope, animation: 'slide-in-left' }).then(function (modal) { $scope.labelResourceListModal = modal; }); } labelResourceListModal(); $scope.keyfilter = { key: '' } // 搜索关键字标红 $scope.badge = function (title) { var re = eval("/" + $scope.keyfilter.key + "/g"); title = title.replace(re, '' + $scope.keyfilter.key + ''); return $sce.trustAsHtml(title) }; $scope.isShowSearchButton = true; $scope.showSearchButtonLeft = function () { $scope.isShowSearchButton = false; $timeout(function () { $(".showSearchInput").focus(); }, 300) } $scope.clearSearch = function () { $scope.isShowSearchButton = true; $scope.keyfilter.key = ""; } // 标签点击事件 $scope.showResourceAboutTheLabel = function (item) { ResourceLibraryService.getResourceBySameLabel(item.labelName).then(function (res) { if (res.code == 3350) { $scope.go('resourceLabelList', { resourceList: res.data, labelName: item.labelName }); } }) /*$scope.labelResourceListModal.show(); $scope.labelTitle = item.labelName; $scope.clearSearch(); $scope.showLoadingToast(); ResourceLibraryService.getResourceFromLabel(item.labelName, $stateParams.recourcecomefrom).then(function (res) { if (res.code == 3350) { $scope.allList = res.data.result; $scope.hideLoadingToast(); } })*/ } //进入记录详情 $scope.goDockingdetails = function (rec) { $scope.islogin = ConfigService.islogin; if (!$scope.islogin) { if (localStorage.wxFlag == "true") { if (localStorage.isUserFocusXW == 0) { var title = localStorage.appidStr; $ionicPopup.alert({ title: '提示', template: '请先关注微信公众号"' + title + '"!' }); return; } else { if (localStorage.isUserBindWx == 0) { var wxFlag = JSON.parse(localStorage.params); if (wxFlag.weChatModel) { $scope.go('bindPhone', { params: localStorage.params, comfrom: 'maincontroller', url: window.location.href.split('#/')[1] }); } else { $scope.go('login'); return; } } else { $scope.go('login'); return; } } } else { $scope.go('login'); return; } } else { $scope.labelResourceListModal.hide(); $scope.go('resourceCommonInfoDetailsPage', { resid: rec.id, isAllVisitor: 1, node: UserService.node }); } }; //进入资源详情 $scope.goResourceDetail = function (resource) { $scope.islogin = ConfigService.islogin; if (!$scope.islogin) { if (localStorage.wxFlag == "true") { if (localStorage.isUserFocusXW == 0) { var title = localStorage.appidStr; $ionicPopup.alert({ title: '提示', template: '请先关注微信公众号"' + title + '"!' }); return; } else { if (localStorage.isUserBindWx == 0) { var wxFlag = JSON.parse(localStorage.params); if (wxFlag.weChatModel) { $scope.go('bindPhone', { params: localStorage.params, comfrom: 'maincontroller', url: window.location.href.split('#/')[1] }); } else { $scope.go('login'); return; } } else { $scope.go('login'); return; } } } else { $scope.go('login'); return; } } else { $scope.labelResourceListModal.hide(); $scope.go('resourceCommonDetailsPage', { recourceid: resource.unique, recourcetype: resource.type, recourcecomefrom: $scope.node, creator: resource.clickthrough, title: resource.title }); } }; // $stateParams.label?$scope.label=JSON.parse($stateParams.label):''; var orgtype = $stateParams.orgtype; $scope.comfrom = $stateParams.comfrom; $scope.pageTitle = $stateParams.title; var recourceid = $stateParams.recourceid; var recourcetype = $scope.type = $stateParams.recourcetype; var recourcecomefrom = $stateParams.recourcecomefrom; var creator = $stateParams.creator; var isCache = $stateParams.isCache; $scope.imagelist = []; $rootScope.imgUrlList = []; //登录者id $scope.userId = UserService.id; /*var recourceid = 100865; var recourcetype = $scope.type = 6; var recourcecomefrom = "320412000"; var creator = 670; $scope.userId = 670;*/ //加载等待页 $scope.isloadingPageFloor = false; //加载失败页 $scope.isloadingPageFail = false; // 提交的评论 $scope.comment = { content: "" }; // 点赞 $scope.TRACE_TYPE_2615 = ConstantService.TRACE_TYPE_2615; // 取消点赞 $scope.TRACE_TYPE_2616 = ConstantService.TRACE_TYPE_2616; // 关注 $scope.TRACE_TYPE_2617 = ConstantService.TRACE_TYPE_2617; // 取消关注 $scope.TRACE_TYPE_2618 = ConstantService.TRACE_TYPE_2618; // 收藏 $scope.TRACE_TYPE_2619 = ConstantService.TRACE_TYPE_2619; // 取消收藏 $scope.TRACE_TYPE_2620 = ConstantService.TRACE_TYPE_2620; // 分享 $scope.TRACE_TYPE_2628 = ConstantService.TRACE_TYPE_2628; // 无权限显示内容 $scope.TRACE_TYPE_STRING_2600 = ConstantService.TRACE_TYPE_STRING_2600; // 私密显示内容 $scope.TRACE_TYPE_STRING_2603 = ConstantService.TRACE_TYPE_STRING_2603; // 基本信息表 resourcelibrary $scope.TABLE_CODE_30001 = ConstantService.TABLE_CODE_30001; // 评论表 info_comment $scope.TABLE_CODE_30002 = ConstantService.TABLE_CODE_30002; // 用户基本信息 sys_users $scope.TABLE_CODE_30043 = ConstantService.TABLE_CODE_30043; //详情页评论 $scope.appComment = function () { $scope.showComment = true; var islogin = ConfigService.islogin; if (!islogin) { $ionicLoading.show({ template: '请登录!', noBackdrop: true }); $timeout(function () { $ionicLoading.hide(); }, 1000); return; } else { var content = $scope.comment.say; //提交评论信息 DetailsService.appComment(id, $stateParams.restype, content, siteName).then(function () { //评论成功后重新获取评论列表 DetailsService.commentList(id, $stateParams.restype).then(function (response) { $scope.comments = response.res.comment; }, function () { }); //重置评论内容为空 $scope.comment.say = ""; }, function () { }); } }; $scope.resource = {}; var getResourceIndustryList = function () { ResourceLibraryService.getResourceIndustryList().then(function (res) { if (res.code == 3350) { $scope.industryList = res.data; } }) } getResourceIndustryList(); // 点赞、收藏、分享的传参 $scope.clickRecord = { //TODO targetid: $stateParams.recourceid, // targetid: 124, moduleid: ConstantService.TABLE_CODE_30001, userid: UserService.id, // userid:1, clicktype: 1, content: '资源详情页' }; // 评论/评论回复的传参 $scope.infoComment = { infoid: recourceid,//资源id infotype: recourcetype,// 资源类别 parentid: 0,// 评论回复时,记录父评论的id parentuserid: 0,// 评论回复时,记录父评论的创建者 content: "",// 评论/回复内容 //TODO creator: UserService.id,// 创建者 updater: UserService.id,// 更新者 // creator:1,// 创建者 // updater:1// 更新者 contenttype: '资源详情页' }; // 获取评论列表的传参 $scope.paramsForInfoCommentList = { mode: 1,// 显示样式:1热门 2全部 infoid: recourceid,// 资源id infotype: recourcetype,// 资源类型 sortkey: 0,// 排序字段 sorttype: "ASC",// 排序方式 moduleid: ConstantService.TABLE_CODE_30002,// 评论表对应的code //TODO userid: UserService.id// 登录者id // userid:1// 登录者id }; /*参数设置*/ /*========================================================================================================================*/ /*逻辑操作*/ var getCascadList = function (arr, index, key) { dataToolsService.getWebCascade(key, 1).then(function (response) { if (UtilService.isDefined(response.data) && response.data.length > 0) { arr[index].content = response.data[0].name; dataToolsService.getWebCascade(response.data[0].code, 0).then(function (res) { var temp = res.data.filter(function (val) { return val.code == key; }) if (temp.length > 0) { arr[index + 1].content = temp[0].name; } }) } }, function () { }) } //点击显示具有相同标签信息的资源 $scope.showSameLabelResource = function (labelName) { ResourceLibraryService.getResourceBySameLabel(labelName).then(function (res) { if (res.code == 3350) { $scope.go('resourceLabelList', { resourceList: res.data, labelName: labelName }); } }) } //上传头像 $scope.clickup = function () { if ($scope.privateName != '专家库') { return } $ionicActionSheet.show({ buttons: [{ text: '从相册上传' }], cancelText: '取消', buttonClicked: function () { var files = document.getElementById('file'); files.click(); $(files).unbind().on('change', function (e) { var data = new FormData(); data.append('file', e.target.files[0]); // $scope.fatherdata.detailList[$scope.imgIndex].imagelist.push(); CommonService.webUploadImage(data).then(function (res) { let params = { node: $scope.node, photo: res.originalName, resourceId: $stateParams.recourceid, restType: "8" } ResourceLibraryService.getdataupdatePhoto(params).then(function (row) { if (row.code = "3350") { $scope.resourceDetail.baseInfoModel.logo = res.originalName; CommonService.showMessage("上传成功!", $scope); } else { CommonService.showMessage("上传失败!", $scope); } }) }) }) return true; } }) }; //获取基本信息详情 var getPublicResourceList = function () { var deferred = $q.defer(); $scope.isloadingPageFloor = true; //$scope.showLoadingToast(); ResourceLibraryService.getPrivateResourceDetail(recourceid, recourcetype, $scope.node).then(function (response) { console.log('resource/detail--获取资源详情:', response); $scope.labelList = response.data.labelContentList; $scope.allLabel = response.otherObj; if ($scope.allLabel != null) { if ($scope.allLabel.length > 3) { $scope.showCollapse = { label: true, showMore: true }; $scope.label = $scope.allLabel.slice(0, 3); } else { $scope.label = $scope.allLabel; } } if ($stateParams.recourcetype == '30') { for (var i = 0; i < response.data.infoSectionList[0].unitlist.length; i++) { if (response.data.infoSectionList[0].unitlist[i].tcname == 'category') { response.data.infoSectionList[0].unitlist.splice(i, 1); break; } } // angular.forEach(response.data.infoSectionList[0].unitlist,function(val){ // if(val.tcname=='category'){ // // } // }) } // 基本信息 orgtype = response.data.baseInfoModel.restype == 6 ? 10104 : response.data.baseInfoModel.restype == 7 ? 10105 : orgtype; $scope.contentList = response.data; $scope.resourceDetail = response.data; deferred.resolve(3350); // $(document).attr("title",$scope.resourceDetail.baseInfoModel.title);//修改title值 document.title = $scope.resourceDetail.baseInfoModel.title; document.getElementById('shareSourc').setAttribute('src', ConfigService.imgurl + $scope.resourceDetail.baseInfoModel.logo); // angular.forEach($scope.contentList.infoSectionList,function (value) { // angular.forEach(value.unitlist,function (content) { // if(content.addimg==1){ // $scope.imagelist=JSON.stringify(content.content).toString(); // var imgWrap = JSON.parse($scope.imagelist); // var v1=eval(imgWrap); // $rootScope.imgUrlList=$rootScope.imgUrlList.concat(v1); // } // }); // }); $scope.scrollTitle = []; $scope.allData = []; angular.forEach(response.data.infoSectionList, function (val) { //桐庐政策库专用(添加编辑功能) if (val.title == "政策详情页") { $scope.policyResource = true; } if (val.title) { angular.forEach(val.unitlist, function (value, index) { if (value.toggle) { value.content = value.content == 0 ? '否' : '是'; } if (value.type == 'cascade') { getCascadList(val.unitlist, index, value.content) } if (value.addimg) { value.imageList = []; value.imageList = JSON.parse(value.content); } }) var i = 0; for (; i < val.unitlist.length; i++) { var value = val.unitlist[i]; if (value.contentflag != 0 && value.type != 'hidden') { break; } } if (i != val.unitlist.length) { $scope.scrollTitle.push(val); if ($scope.scrollTitle.length == 1) { val.unitListLength = val.unitlist.length; $scope.allData.push(val); } else { $scope.allData.push({ title: val.title, ishiddensection: val.ishiddensection, unitListLength: val.unitlist.length }) } } } }) // if($scope.scrollTitle[0]){ // $scope.scrollTitle[0].ishiddensection=true; // } if ($scope.allData[0]) { $scope.allData[0].ishiddensection = true; // 处理初中学历 if ($scope.allData[0].unitlist){ angular.forEach($scope.allData[0].unitlist,function (val) { if (val.title === '学历' && val.content === '3795'){ val.content = '初中'; } }) } } $scope.isloadingPageFloor = false; $scope.isloadingPageFail = false; //$scope.hideLoadingToast(); console.log($scope.allData) }, function () { $scope.isloadingPageFloor = false; //$scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope); } $scope.isloadingPageFail = true; deferred.resolve(3351); }) ResourceLibraryService.getHistoryDetail(recourceid, $scope.node).then(function (res) { if (res.code == 3350) { $scope.historyList = res.data; } }) return deferred.promise; }; //点击切换页 $scope.changeSelecteds = function (index) { angular.forEach($scope.allData, function (row) { row.ishiddensection = false }) $scope.allData[index].ishiddensection = true $scope.allData[index].unitlist = $scope.scrollTitle[index].unitlist; } // 长按删除标签 $scope.skipDown = function (index, row) { var confirmPopup = $ionicPopup.confirm({ title: '提示', template: '确定要删除吗?', cancelText: '取消', okText: '确定' }); confirmPopup.then(function (res) { if (res) { ResourceLibraryService.labelintelligentdel($stateParams.recourceid, row.labelName, row.labelKey).then(function (res) { if (res.code == 3350) { $scope.allLabel.splice(index, 1) CommonService.showMessage("删除成功", $scope); $state.reload(); } else { CommonService.showMessage(res.message, $scope); } }) } else { console.log('You are not sure'); } }); } // 获取其他信息 getPublicResourceList().then(function (data) { if (data == 3350) { $scope.showLoadingToastUtilEnd(); ResourceLibraryService.getOtherDetail(recourceid, recourcetype, $scope.node).then(function (response) { console.log('response', response) $scope.hideLoadingToast() if (response.code == 3350) { $scope.infoSectionList = response.data.infoSectionList; $scope.resourceDetail.infoSectionList = $scope.resourceDetail.infoSectionList.sort(function (a, b) { return a.sort - b.sort; }); for (var key in response.data.typecodemap) { if (!$scope.resourceDetail.typecodemap) { $scope.resourceDetail.typecodemap = {}; } $scope.resourceDetail.typecodemap[key] = response.data.typecodemap[key]; } angular.forEach(response.data.infoSectionList, function (val, index) { if (val.title) { angular.forEach(val.unitlist, function (value) { if (value.addimg) { value.imageList = []; value.imageList = JSON.parse(value.content); } }) var i = 0; for (; i < val.unitlist.length; i++) { var value = val.unitlist[i]; if (value.contentflag != 0 && value.type != 'hidden') { break; } } if (i != val.unitlist.length) { $scope.scrollTitle.push(val); if ($scope.scrollTitle.length == 1) { val.unitListLength = val.unitlist.length; $scope.allData.push(val); } else { $scope.allData.push({ title: val.title, ishiddensection: val.ishiddensection, unitListLength: val.unitlist.length }) } } } }) console.log($scope.allData) } else { $ionicPopup.alert({ title: '提示', template: "服务器错误" }); } }).catch(function (res) { $scope.hideLoadingToast(); $ionicPopup.alert({ title: '提示', template: "服务器错误" }); }) } }); $scope.clickThis = function (url) { var wholeUrl = "http://" + url; window.open(wholeUrl, "_blank"); }; //获取热门评论列表 var getInfoCommentList = function () { CommentService.getInfoCommentList($scope.paramsForInfoCommentList).then(function (response) { // 评论列表 $scope.comments = response.data; }, function () { }) }; getInfoCommentList(); // $scope.repeatLoad = function () { // $scope.isloadingPageFail = false; // getPublicResourceList(); // }; $scope.isHiddenAction = function (index) { $scope.allData[index].unitlist = $scope.scrollTitle[index].unitlist; $scope.allData[index].ishiddensection = !$scope.allData[index].ishiddensection; console.log($scope.allData) // $scope.scrollTitle[index].ishiddensection=!$scope.scrollTitle[index].ishiddensection; }; // 详情页跳转 $scope.jumpToLink = function (temp) { $scope.showSelectLink = false; if (temp.groupid == "0") { $scope.go('resourceDetails', { recourceid: temp.unique, recourcetype: temp.type, recourcecomefrom: UserService.node, title: temp.title, }); } else { $scope.go('resourceCommonDetailsPage', { recourceid: temp.unique, recourcetype: temp.type, recourcecomefrom: UserService.node, creator: temp.clickthrough, title: temp.title, // label:$stateParams.label }); } } $scope.showSelectLink = false; $scope.showSelectedBox = function (item, index, outerIndex, innerIndex) { if (item == undefined) { if (!$scope.allData[outerIndex].unitlist[index].linkList) { return; } var temp = $scope.allData[outerIndex].unitlist[index].linkList[0]; $scope.jumpToLink(temp); } else { $scope.showSelectLink = true; } }; $scope.isVisitHiddenAction = function (index, parentIndex) { $scope.historyList[parentIndex].infoSectionList[index].ishiddensection = !$scope.historyList[parentIndex].infoSectionList[index].ishiddensection; }; // 弹出简单评论框 $scope.showComment = true; $scope.focus_write = function () { $scope.showComment = false; }; // 隐藏简单评论框 $scope.hiddenComment = function () { $scope.showComment = true; }; // 简单评论框内容变更,判断 发表 按钮颜色 $scope.commentValue = function () { var search_history = angular.element(document.getElementsByClassName("my_comment")); if (UtilService.isDefined($scope.comment.content) && $scope.comment.content.length > 1000) { if ($scope.app) { UtilService.showMess("您的评论已超过1000字!"); } else { CommonService.showMessage("您的评论已超过1000字!", $scope); } $scope.comment.content = $scope.comment.content.substr(0, 1000); } if (UtilService.isDefined($scope.comment.content) && $scope.comment.content != 0) { $scope.commentNotnull = { "background-color": "#2a90d7", "text-decoration": "underline" }; } else { $scope.commentNotnull = { "background-color": "#ccc" }; } }; var search_history = angular.element(document.getElementsByClassName("my_comment")); //查看信息的详情时跳转 $scope.goLibrary = function () { $scope.go(''); }; //单条履历信息展开并赋值 $scope.opencardWrap = function (currentIndex) { $scope.showLoadingToast(); dataToolsService.getConnectioninfoDetailByConnid($scope.historyList[currentIndex].id, 1000002, 0, $scope.node).then(function (res) { dataToolsService.getConnectionOtherInfoDetail($scope.historyList[currentIndex].id, 1000002, 0, $scope.node).then(function (response) { if (res.data.id) { // $scope.historyList[currentIndex]= res.data; $scope.historyList[currentIndex].baseInfoModel = res.data.baseInfoModel; $scope.historyList[currentIndex].infoSectionList = res.data.infoSectionList.concat(response.data.infoSectionList); $scope.historyList[currentIndex].typecodemap = Object.assign(res.data.typecodemap, response.data.typecodemap); } else { $scope.historyList[currentIndex].baseInfoModel = response.data.baseInfoModel; $scope.historyList[currentIndex].infoSectionList = response.data.infoSectionList; $scope.historyList[currentIndex].typecodemap = response.data.typecodemap; } if (UtilService.isDefined($scope.historyList[currentIndex])) { // console.log("=============opencardWrap获取走访履历详情================="); var tempArr = []; angular.forEach($scope.historyList[currentIndex].infoSectionList, function (val) { if (val != null && val.title) { angular.forEach(val.unitlist, function (value) { if (value.addimg) { value.imageList = []; value.imageList = JSON.parse(value.content); } }) } var i = 0; if (val != null) { for (; i < val.unitlist.length; i++) { var value = val.unitlist[i]; if (value.contentflag != 0 && value.type != 'hidden') { break; } } if (i != val.unitlist.length) { tempArr.push(val); } } }) // 基本信息 $scope.historyList[currentIndex].isShowVisitContent = !$scope.historyList[currentIndex].isShowVisitContent; $scope.historyList[currentIndex].infoSectionList = tempArr; $scope.historyList[currentIndex].infoSectionList[0].ishiddensection = true; } $scope.hideLoadingToast(); }, function () { $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope); } }); }) }; //单条履历信息中的模块展开 $scope.openCard = function () { $scope.historyList.isShowCard = !$scope.historyList.isShowCard; }; //单挑履历的收起 $scope.opencardHiddenWrap = function (currentIndex) { $scope.historyList[currentIndex].isShowVisitContent = !$scope.historyList[currentIndex].isShowVisitContent; }; // 控制重复点击 var flag = 1; // 操作:点赞、关注、收藏 $scope.praiseAction = function (clicktype, recourceid, moduleid, ind) { console.log('点击收藏', clicktype, recourceid, moduleid, ind); if (flag == 0) { return; } flag = 0; // 点赞 or 收藏 资源 // 取消点赞 or 取消收藏 资源 if (clicktype == $scope.TRACE_TYPE_2615 || clicktype == $scope.TRACE_TYPE_2619 || clicktype == $scope.TRACE_TYPE_2616 || clicktype == $scope.TRACE_TYPE_2620) { $scope.clickRecord.targetid = recourceid; $scope.clickRecord.moduleid = moduleid; } else if (clicktype == $scope.TRACE_TYPE_2617 || clicktype == $scope.TRACE_TYPE_2618) { // 关注 用户 // 取消关注 用户 $scope.clickRecord.targetid = $scope.resourceDetail.creator; $scope.clickRecord.moduleid = $scope.TABLE_CODE_30043; } $scope.clickRecord.clicktype = clicktype; CommentService.postClickFavour($scope.clickRecord).then(function (response) { if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) { // 点赞 if (clicktype == $scope.TRACE_TYPE_2615) { // 信息 if (moduleid == $scope.TABLE_CODE_30001) { $scope.resourceDetail.favourcount = $scope.resourceDetail.favourcount + 1; $scope.resourceDetail.favour = !$scope.resourceDetail.favour; } else // 评论 if (moduleid == $scope.TABLE_CODE_30002) { $scope.comments[ind].favourcount = $scope.comments[ind].favourcount + 1; $scope.comments[ind].favour = !$scope.comments[ind].favour; } } else // 取消点赞 if (clicktype == $scope.TRACE_TYPE_2616) { // 信息 if (moduleid == $scope.TABLE_CODE_30001) { $scope.resourceDetail.favourcount = $scope.resourceDetail.favourcount - 1; $scope.resourceDetail.favour = !$scope.resourceDetail.favour; } else // 评论 if (moduleid == $scope.TABLE_CODE_30002) { $scope.comments[ind].favourcount = $scope.comments[ind].favourcount - 1; $scope.comments[ind].favour = !$scope.comments[ind].favour; } } // 关注 // 取消关注 else if (clicktype == $scope.TRACE_TYPE_2617 || clicktype == $scope.TRACE_TYPE_2618) { $scope.resourceDetail.focus = !$scope.resourceDetail.focus; } // 收藏 // 取消收藏 else if (clicktype == $scope.TRACE_TYPE_2619 || clicktype == $scope.TRACE_TYPE_2620) { $scope.resourceDetail.collect = !$scope.resourceDetail.collect; } } // UtilService.showMess(response.clickStatus); // 若是评论点赞,则刷新评论列表 if (moduleid == $scope.TABLE_CODE_30002) { $timeout(function () { getInfoCommentList(); }, 650); } // 恢复可用 flag = 1; }, function () { // 恢复可用 flag = 1; if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope); } }) }; //分享 $scope.shareflg = false; $scope.openShare = function () { if ($scope.app) { $scope.shareflg = true; } else { $scope.shareMessage(); } }; $scope.closeShareBox = function () { $scope.shareflg = false; }; //TODO $scope.showShareWechat = false; $scope.closeShare = function () { $scope.showShareWechat = false; }; var sharelink = "https://blog.csdn.net/molong421/article/details/51586194"; //0:QQ,1:QQ空间,2:微信,3:微信朋友圈,4:新浪微博 $scope.shareMessage = function (type) { $scope.shareflg = false; var linkUrl = ConfigService.webserver + '#/resourceCommonDetailsPage/' + $stateParams.recourceid + '/' + $stateParams.recourcetype + '/' + $scope.node + '/' + $stateParams.title; var imagurl = $scope.resourceDetail.baseInfoModel.logo ? (ConfigService.imgurl + $scope.resourceDetail.baseInfoModel.logo) : "https://cordova.apache.org/static/img/cordova_bot.png"; var message = { title: $scope.resourceDetail.baseInfoModel.title, description: $scope.resourceDetail.baseInfoModel.title.substring(0, 19), url: linkUrl, imageurl: imagurl }; if ($scope.app) { $scope.showLoadingToast(); // var message = { // title: $scope.resourceDetail.title, // description: $scope.resourceDetail.title.substring(0,19), // url: sharelink, // imageurl: imagurl // }; switch (type) { case 0: case 1: ShareService.shareToQQ(type, message).then(function () { $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess("QQ分享成功"); } else { CommonService.showMessage("QQ分享成功", $scope); } }, function (error) { $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(error); } else { CommonService.showMessage(error, $scope); } }); break; case 2: ShareService.shareToWechat(type, message).then(function () { // UtilService.showMess("微信分享成功"); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess("微信分享成功"); } else { CommonService.showMessage("微信分享成功", $scope); } }, function (error) { // UtilService.showMess(error); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(error); } else { CommonService.showMessage(error, $scope); } }); break; case 3: ShareService.shareToWechat(type, message).then(function () { // UtilService.showMess("微信分享成功"); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess("微信分享成功"); } else { CommonService.showMessage("微信分享成功", $scope); } }, function (error) { // UtilService.showMess(error); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(error); } else { CommonService.showMessage(error, $scope); } }); break; case 4: ShareService.shareToWeibo(message).then(function () { // UtilService.showMess("新浪微博分享成功"); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess("新浪微博分享成功"); } else { CommonService.showMessage("新浪微博分享成功", $scope); } }, function (error) { // UtilService.showMess(error); $scope.hideLoadingToast(); if ($scope.app) { UtilService.showMess(error); } else { CommonService.showMessage(error, $scope); } }); break; default: break; } $timeout(function () { $scope.hideLoadingToast(); }, 10000); } else { $scope.showShareWechat = true; var content = document.getElementById('qrcode-dialog1'); content.innerHTML = ''; var qrcode = new QRCode(content, { text: $scope.resourceDetail.baseInfoModel.title, // title: $scope.resourceDetail.baseInfoModel.title, // description: $scope.resourceDetail.baseInfoModel.title.substring(0,19), // url: linkUrl, // imageurl: imagurl, width: 200, height: 200 }) qrcode.makeCode(linkUrl); } }; //发布普通评论 $scope.publishComment = function (type, comment) { $scope.showComment = true; var content = $scope.comment.content; $scope.infoComment.content = content; // 评论 if (type == 1) { $scope.infoComment.parentid = 0;// 评论回复时,记录父评论的id $scope.infoComment.parentuserid = 0;// 评论回复时,记录父评论的创建者 } // 评论回复 else if (type == 2) { $scope.infoComment.parentid = comment.id;// 评论回复时,记录父评论的id $scope.infoComment.parentuserid = comment.creator;// 评论回复时,记录父评论的创建者 } //提交评论信息 $scope.showLoadingToast(); CommentService.publishSimpleComment($scope.infoComment).then(function () { if ($scope.app) { UtilService.showMess("评论成功"); } else { CommonService.showMessage("评论成功", $scope); } $scope.infoComment.content = ""; getInfoCommentList(); /*if ($scope.comments.length >= 3) { $timeout(function () { $scope.getInfoCommentList(); }, 650); }*/ $scope.hideLoadingToast(); }, function () { $scope.hideLoadingToast(); }); }; //发表详细评论 $scope.releaseComment = function () { $scope.go('releaseComment', { infoid: recourceid, infotype: recourcetype, comlen: $scope.commentlist.length, recourcecomefrom: $scope.node }) }; //点击抢沙发 $scope.hadSoft = function () { $scope.showComment = false; $(".my_comment").focus(); }; $scope.showComment = true; $scope.focus_write = function () { scrollToBottom();//滚动至底部 $scope.showComment = false; $(".my_comment").focus(); }; $scope.hiddenComment = function () { $scope.showComment = true; }; //跳转到评论详情页comment $scope.goComment = function (comment) { $scope.go("Reply", { comment: comment, infotype: comment.infotype, infoid: comment.infoid, comfrom: '资源详情页' }) }; //跳转到评论发布者的主页 $scope.goPublisher = function () { if ($scope.creatorId != 0) { $scope.go('publisher', { Id: $scope.creatorId }); } }; // 滚动至底部 var scrollToBottom = function () { $timeout(function () { $ionicScrollDelegate.$getByHandle("calenderContent").scrollBottom(); }, 0); }; //进入评论列表页 // $scope.goCommentList = function () { // $timeout(function () { // $scope.go('comment', { // mode: 2, // infoid: $scope.resourceDetail.id, // infotype: $scope.resourceDetail.restype // }); // }, 350); // }; //进入资源详情 $scope.jumpResourceDetail = function () { // 再跳转到资源详情页 $scope.go('resourceCommonDetailsPage', { recourceid: recourceid, recourcetype: recourcetype, recourcecomefrom: $scope.node + " ", creator: creator, isCache: true, // 是否要强制刷新, // label:$stateParams.label }); }; // 申请权限消耗普适积分 var consumptionPushPoints = function (authorityid) { // 获取录入界面的传参 $scope.requestModel = { data: [], userid: UserService.id }; // 传参格式 $scope.requestModel.data.push(authorityid); AccountService.consumptionPushPoints($scope.requestModel).then(function (response) { if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) { // console.log("==============申请权限消耗普适积分成功================"); // 消耗成功后刷新页面 $scope.jumpResourceDetail(); } else if (response.code == ConstantService.INTERFACE_STATUS_CODE_21102) { // 提示积分不足 if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_21102); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_21102, $scope); } } }, function () { // 购买失败 if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope); } }); }; //查看将消耗 $scope.isCanApply = function (authorityid) { /*// 正常访问,退出 if($scope.resourceDetail.contactorshowcode == ConstantService.TRACE_TYPE_2602 || $scope.resourceDetail.contactorshowcode == ConstantService.TRACE_TYPE_2603){ return; }*/ // 获取权限详情 $scope.pushvalue = 0; AccountService.getAuthorityInfo(authorityid).then(function (response) { if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) { // 消耗成功后刷新页面 $scope.authorityinfo = response.data; $scope.pushvalue = $scope.authorityinfo.pushvalue; $ionicPopup.show({ title: '查看将消耗', template: "

" + "" + "{{pushvalue}}" + "普适分

", scope: $scope, buttons: [ { text: "取消", onTap: function () { // console.log('取消') } }, { text: '申请', type: "button-positive", onTap: function () { // console.log('申请'); // 申请权限消耗普适积分 consumptionPushPoints(authorityid); } } ] }); } }, function () { // 购买失败 if ($scope.app) { UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR); } else { CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope); } }); }; //是否可以申请权限 $scope.isApplyAuthority = function (authorityid) { // var tempdata = { // title: $scope.resourceDetail.title, // recourceid: recourceid, // recourcetype: recourcetype, // recourcecomefrom: $scope.node, // authorityid: authorityid, // type: ConstantService.TRACE_TYPE_2640 // }; // $scope.go("resourceApply", { authoritydata: angular.toJson(tempdata) }) }; //打开操作表:设置/编辑 $scope.openActionSheet = function () { // isedit:是否可以编辑资源,isset:是否可以设置权限 var buttonlist = []; //TODO // if($scope.resourceDetail.ishasedit){ // buttonlist.push({text: '编辑'}) // } if ($scope.isuserInOrg) { $scope.resourceDetail.ishasedit = true; } if ($scope.resourceDetail.ishasset) { buttonlist.push({ text: '设置' }) } // if ($scope.resourceDetail.ishasedit&&(recourcetype==30||recourcetype==31||recourcetype==32||recourcetype==33||recourcetype==34)) { if ($scope.resourceDetail.ishasedit) { buttonlist.push({ text: '编辑' }) } //桐庐政策库专用 if ($scope.policyResource) { buttonlist.push({ text: '编辑' }); } $ionicActionSheet.show({ buttons: buttonlist, cancelText: '取消', buttonClicked: function (index) { //桐庐政策库专用 if ($scope.policyResource || $scope.isuserInOrg) { index = 1; } if (index == 0) { $scope.go("selectFieldsToSet", { typecodemap: $scope.resourceDetail.typecodemap, resid: recourceid, typecode: ConstantService.TABLE_CODE_30001 }); } else if (index == 1) { if ($scope.policyResource || $stateParams.restype == 30 || $stateParams.restype == 31 || $stateParams.restype == 32 || $stateParams.restype == 33 || $stateParams.restype == 34) { $scope.go('visitModularForm', { companyid: $scope.resourceDetail.baseInfoModel.oid, pageid: $stateParams.recourcetype, orgtype: orgtype, isedit: 1,// isedit:对应的是0新增/1编辑/2复制并新建 connid: $scope.resourceDetail.id, node: $scope.node, pagecode: 1000030, title: $scope.resourceDetail.baseInfoModel.title, pageTitle: '编辑 ' + $scope.resourceDetail.baseInfoModel.title, comfrom: 'resource', restype: recourcetype }); } else { ResourceLibraryService.getPageId($stateParams.recourcetype).then(function (res) { $scope.go('visitModularForm', { companyid: $scope.resourceDetail.baseInfoModel.oid, pageid: res.data, orgtype: orgtype, isedit: 1,// isedit:对应的是0新增/1编辑/2复制并新建 connid: $scope.resourceDetail.id, node: $scope.node, pagecode: 1000030, title: $scope.resourceDetail.baseInfoModel.title, pageTitle: '编辑 ' + $scope.resourceDetail.baseInfoModel.title, comfrom: 'resourceCommonDetailsPage', restype: recourcetype, resourcetype: recourcetype, }); }); } } return true; } }); }; // 新建走访 $scope.createNewPage = function (type, companyid) { console.log({ companyid: $scope.resourceDetail.oid, pageid: 1, orgtype: $stateParams.recourcetype == '6' ? 10104 : 10105, isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 connid: 0, node: $scope.node, pagecode: 1000003, title: $scope.resourceDetail.baseInfoModel.title, pageTitle: $scope.comfrom == 'typein' ? '新建录入' : '新建走访' }) // return; $scope.go('visitModularForm', { companyid: $scope.resourceDetail.baseInfoModel.oid, pageid: $stateParams.recourcetype == '6' ? 1 : 2, orgtype: $stateParams.recourcetype == '6' ? 10104 : 10105, isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 connid: 0, node: $scope.node, pagecode: $stateParams.recourcetype == '6' ? 1000003 : 1000004, title: $scope.resourceDetail.baseInfoModel.title, pageTitle: $scope.comfrom == 'typein' ? '新建录入' : '新建走访', comfrom: 'resourceLibrary', templettype: $stateParams.recourcetype, resid: $scope.resourceDetail.id }); // switch (type) { // case 6: // if($scope.comfrom=='typein'){ // if($stateParams.recourcecomefrom=='320117005'||$stateParams.recourcecomefrom=='320117003'||$stateParams.recourcecomefrom=='320117002'||$stateParams.recourcecomefrom=='320117001'||$stateParams.recourcecomefrom=='320117004'){ // $scope.go('typeinAllModal', { // companyid: companyid, // pageid: 11, // orgtype: orgtype, // isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: 0, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // }else{ // $scope.go('typeinInformation', { // companyid: companyid, // pageid: 3, // orgtype: orgtype, // isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: 0, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // } // }else{ // if($stateParams.recourcecomefrom=='320117005'||$stateParams.recourcecomefrom=='320117003'||$stateParams.recourcecomefrom=='320117002'||$stateParams.recourcecomefrom=='320117001'||$stateParams.recourcecomefrom=='320117004'){ // $scope.go('visitModularForm', { // companyid: companyid, // pageid: 12, // orgtype: orgtype, // isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: 0, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // }else{ // $scope.go('visitModularForm', { // companyid: companyid, // pageid: 1, // orgtype: orgtype, // isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: 0, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // } // } // break; // case 7: // $scope.go('visitModularForm', { // companyid: companyid, // pageid: 2, // orgtype: 10105, // isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: 0, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // break; // return; // } }; // 复制并新建 $scope.copyAndNewPage = function (pageid, connid, node, pagecode) { $scope.go('visitModularForm', { companyid: 0, pageid: pageid, orgtype: orgtype, isedit: 2,// isedit:对应的是0新增/1编辑/2复制并新建 connid: connid, // node:$stateParams.recourcecomefrom, pagecode: pagecode, node: node, title: $stateParams.title, pageTitle: $scope.comfrom == 'typein' ? '复制并编辑录入' : '复制并编辑走访' }); // switch (pageid) { // case 3: // $scope.go("unitOrPersonalBaseInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // case 4: // $scope.go("recordDemandInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // case 5: // $scope.go("recordAchievementsInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // case 6: // $scope.go("recordProductInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // case 7: // $scope.go("recordPatentInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // case 8: // $scope.go("recordTalentInfo", {pageid: pageid, connid: connid, isedit: 2}); // break; // default: // $scope.go('visitModularForm', { // companyid: 0, // pageid: pageid, // orgtype: 1, // isedit: 2,// isedit:对应的是0新增/1编辑/2复制并新建 // connid: connid, // node:$stateParams.recourcecomefrom, // pagecode:1000003, // title:$stateParams.title // }); // return; // } }; // 点击头像或名字进入个人主页 $scope.goPublisher = function (userid) { if (userid != 0) { $scope.go('publisher', { Id: userid }); } }; //走访记录的其他信息 $scope.sourceInfo = []; //点击图片放大 $scope.bigImage = false; //初始默认大图是隐藏的 $scope.hideBigImage = function () { $timeout(function () { if ($scope.app) { $scope.setStatusBar(0); } $scope.bigImage = false; }, 400); }; $scope.shouBigImage = function (outerIndex, innerIndex, index) { //传递一个参数(图片的URl) if ($scope.app) { $scope.setStatusBar(1); } $scope.imgUrlList = $scope.allData[outerIndex].unitlist[innerIndex].imageList; var str = $scope.imgUrlList[index].sourceName.split('.'); if (str && str.length > 0 && str[1] != 'jpg' && str[1] != 'gif' && str[1] != 'bmp' && str[1] != 'png' && str[1] != 'jpeg') { if ($scope.imgUrlList[index]) { window.open(ConfigService.imgurl + $scope.imgUrlList[index].sourceName); return; } } $scope.bigImage = true; //显示大图 $(function () { $('div.pinch-zoom').each(function () { new RTP.PinchZoom($(this), {}); }); }); $ionicSlideBoxDelegate.update();//重绘,让图片显示出来 //图片总数量 setTimeout(function () { // console.log(parseInt($ionicSlideBoxDelegate.slidesCount())); // console.log(parseInt($ionicSlideBoxDelegate.currentIndex())); $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, 0); //获取图片 var imgObj = document.getElementsByClassName('bigimage'); var n; for (n = 0; n < imgObj.length; n++) { // 获取图片的原始高度和宽度 var oldWid = imgObj[n].naturalWidth; var oldHei = imgObj[n].naturalHeight; var screen = document.body.offsetWidth; var screenH = window.innerHeight; // console.log(oldWid/oldHei); // console.log(screen ); var rate = oldWid / oldHei; if (oldWid >= screen && oldHei >= screenH) { var tw = screen; var th = tw / rate; if (th < screenH) { imgObj[n].style.width = tw + 'px'; imgObj[n].style.height = th + 'px'; imgObj[n].style.marginTop = (screenH - th) / 2 + 'px'; } else { imgObj[n].style.width = screenH * rate + 'px'; imgObj[n].style.height = screenH + 'px'; imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px'; } } else if (oldWid >= screen && oldHei <= screenH) { imgObj[n].style.width = screen + 'px'; imgObj[n].style.height = screen / rate + 'px'; imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px'; } else if (oldWid <= screen && oldHei >= screenH) { // var hh=screenH; // var ww=screenH*rate; imgObj[n].style.width = screenH * rate + 'px'; imgObj[n].style.height = screenH + 'px'; imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px'; } else { imgObj[n].style.width = oldWid + 'px'; imgObj[n].style.height = oldHei + 'px'; imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px'; imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px'; } } }, 500); }; //去认领企业 $scope.goClaim = function () { $scope.go('identifyForm', { pageTitle: "企业认证", code: 4803, type: 5100, id: 0, action: 'submit', pagesize: 15, pagenum: 1, companyName: $scope.resourceDetail.baseInfoModel.title }); } $scope.goBackPage = function () { if ($stateParams.comfrom == "privateResource") { $scope.go('privateResource', { res: angular.toJson($stateParams.res), groupid: $stateParams.groupid, restype: $stateParams.restype, filterList: $stateParams.filterList, MoreData: $stateParams.MoreData, capacityparams: $stateParams.capacityparams, checkedsort: $stateParams.checkedsort }) } else { $scope.goback(); } } $scope.goToMonthReport = function () { //获取月报表数据中的年份数据(false) statisticsReportService.getTongLuReportYear($scope.resourceDetail.baseInfoModel.oid, false).then(function (res) { if (res.code == 3350) { if (res.data.length != 0) { $scope.go('tongluMonthReport', { resource: $scope.resourceDetail }); } else { if ($scope.app) { UtilService.showMess(''); } else { CommonService.showMessage('暂无月报数据', $scope) } } } }) } $scope.goToYearReport = function () { $scope.go('tongluYearReport', { datalist: $scope.datalist, title: $stateParams.title, orgid: $scope.resourceDetail.baseInfoModel.oid }); } } )