12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228 |
- angular.module('push')
- .controller('privateResourceCtrl', function ($q, $scope, $ionicActionSheet, $ionicHistory, $ionicSlideBoxDelegate, ResourceLibraryService, $stateParams, $timeout, $ionicScrollDelegate,
- UtilService, $ionicPopup, resourceLibraryTempData, $ionicListDelegate, AuthorityService,
- UserService, taskModuleService, ConfigService, ActivityService, ConstantService, dataToolsService, CommonService, $ionicModal) {
- //TODO
- if ($scope.app) {
- $scope.setStatusBar(1);
- }
- $scope.defaultLan = UserService.defaultLan;
- $scope.isWeb = !$scope.isapp;
- $scope.labelKeys = '';
- // $scope.comfromWeb=sessionStorage.comfrom=='web';
- // sessionStorage.comfrom='';
- console.log($stateParams);
- $scope.privateName = $stateParams.privateName
- $scope.node = UserService.node;
- $scope.deleteSet = new Set();
- $scope.Connections = [
- {restype: '2', url: 'https://www.51jishu.com/result', name: '成果大厅'},
- {
- restype: '8',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/searchExpert',
- name: '专家大厅'
- },
- {
- restype: '3',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/newPolicy?dataType=3',
- name: '政策扶持'
- },
- {restype: '40', url: 'https://12348.sft.zj.gov.cn/main/index/', name: '法律咨询'},
- {restype: '40', url: 'http://app.gjzwfw.gov.cn/jmopen/webapp/html5/swsxxcx/index.html', name: '会计咨询'},
- {restype: '40', url: 'http://zhejiang.chinatax.gov.cn/col/col13316/index.html', name: '税务咨询'},
- {restype: '40', url: 'https://zscqyjs.zjamr.zj.gov.cn/api/othing/cms/fwjg/1/0/0.html', name: '专利咨询'},
- {restype: '40', url: 'https://jg.sac.net.cn/pages/publicity/securities-list.html', name: '券商咨询'},
- {restype: '39', url: 'https://www.hzjrzhfw.com/home/index', name: '银行贷款'},
- {
- restype: '39',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/technologyFinance',
- name: '科技金融'
- },
- {
- restype: '41',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/makerSpace',
- name: '众创空间'
- },
- {
- restype: '41',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/incubator',
- name: '孵化器'
- },
- {
- restype: '41',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/comprehensive',
- name: '服务F综合体'
- },
- {
- restype: '42',
- url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/handle',
- name: '项目申报'
- },
- ]
- $scope.jumyclick = function (url) {
- console.log(url)
- window.open(url)
- }
- $scope.field = ['enterprisequalification', 'usertask_type', 'cooperationmodel', 'proficiency', 'cooperationmodel'];
- $scope.genre = ["category"];
- var category = $stateParams.category;
- $scope.authority = false;
- $scope.authority = $stateParams.authority == 'true';
- if ($stateParams.restype == 3 || $stateParams.restype == 30 || $stateParams.restype == 31 ||
- $stateParams.restype == 32 || $stateParams.restype == 33 || $stateParams.restype == 34) {
- $scope.canDelete = $stateParams.authority == 'true';
- }
- $scope.hasAuth = false;
- ResourceLibraryService.judgeManager(UserService.id, 10501).then(function (res) {
- // console.log(res);
- $scope.hasAuth = res.data;
- })
- taskModuleService.thisUserIsAdmin().then(function (res) {
- if (res.code == 3350) {
- $scope.isAdmin = res.data;
- }
- })
- $stateParams.capacityparams ? $scope.capacityparams = $stateParams.capacityparams : ''
- $scope.filterList = $stateParams.filterList;
- //加载等待页
- $scope.isloadingPageFloor = false;
- //全部企业加载失败页
- $scope.isloadingPageFailAll = false;
- //我的企业加载失败页
- $scope.isloadingPageFail = false;
- // console.log($stateParams);
- //1:需求,2:成果,6:企业,8:人才
- var res = angular.fromJson($stateParams.res);
- //TODO
- $scope.groupid = $stateParams.groupid;// 资源库文件夹id
- $scope.restype = $stateParams.restype;// 资源库类别
- var pagenum = $scope.pagenum = 0;// 索引库分页索引值,默认第一页:0
- var userid = $scope.userid = UserService.id;//查询时需的用户id
- $scope.keyfilter = {
- key: ""// 搜索关键词
- }
- $scope.name = res.name;
- // console.log(reclib.parentid,reclib.moduleid,$scope.modlibid,$scope.libtype,$scope.name);
- // 需求库名称
- $scope.privateName = $stateParams.privateName;
- // 我的XX/全部XX XX→需求、成果
- $scope.privateContent = $stateParams.privateContent;
- var checkedresource = {};//单个分享时选中的资源
- var checkedindex = -1;//多个分享时第一个选择的索引
- $scope.checkedresourcelist = [];//多个分享时选中的资源
- //拼凑筛选条件
- if (!$scope.labelKeys || $scope.labelKeys == "") {
- $scope.labelKeys = "";
- angular.forEach($scope.filterList, function (res) {
- if (res.title != '潜力库') {
- angular.forEach(res.items, function (item) {
- if (item.selected && item.labelName != '全部') {
- $scope.labelKeys += item.labelKey + ",";
- }
- })
- }
- })
- }
- $scope.tabs = [];
- var chooseIndex = resourceLibraryTempData.getCategoryIndex();//当前频道索引
- $scope.index = chooseIndex;
- $scope.checked = resourceLibraryTempData.getChecked();
- $scope.checked.classificationType = $scope.restype;
- // $scope.goback = function () {
- // if (UserService.node == 320481000) {
- // $scope.go("tab.activityIndex");
- // } else {
- // $scope.go("tab.resourceLibrary");
- // }
- // }
- $scope.goback = function () {
- $scope.go("tab.activityIndex");
- }
- //通过浏览器地址栏里面的参数来获取moduleid和restype
- var href = window.location.href;
- var splitArr = href.split('privateResource');
- if (splitArr.length >= 2) {
- console.log(splitArr)
- //重写返回功能
- $scope.goback = function () {
- $scope.go("tab.activityIndex");
- }
- var split = splitArr[1].split('/');
- if (split.length >= 2) {
- $scope.groupid = split[1];
- $scope.restype = split[2];
- if (sessionStorage.restype == "0") {
- $scope.privateName = '科创联盟入驻企业库';
- }
- if (sessionStorage.restype == "1") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '需求库';
- } else {
- $scope.privateName = 'Demands Database';
- }
- }
- if (sessionStorage.restype == "2") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '成果库';
- } else {
- $scope.privateName = 'Achievements Database';
- }
- }
- if (sessionStorage.restype == "3") {
- $scope.privateName = '政策库';
- }
- if (sessionStorage.restype == "6") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '企业库';
- } else {
- $scope.privateName = 'Enterprise Database';
- }
- }
- if (sessionStorage.restype == "7") {
- $scope.privateName = '高校库';
- }
- if (sessionStorage.restype == "8") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '专家库';
- } else {
- $scope.privateName = 'Experts Database';
- }
- }
- if (sessionStorage.restype == "35") {
- $scope.privateName = '技术经理人库';
- }
- if (sessionStorage.restype == "36") {
- $scope.privateName = '产学研备案库库';
- }
- if (sessionStorage.restype == "38") {
- $scope.privateName = '人才库';
- }
- if (sessionStorage.restype == "39") {
- $scope.privateName = '金融库';
- }
- if (sessionStorage.restype == "40") {
- $scope.privateName = '中介库';
- }
- if (sessionStorage.restype == "41") {
- $scope.privateName = '平台库';
- }
- if (sessionStorage.restype == "43") {
- $scope.privateName = '武进区科技创新创业联盟库';
- }
- if (sessionStorage.restype == "44") {
- $scope.privateName = '创新创业联盟导师库';
- }
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 1);
- } else {
- $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 9);
- }
- }
- }
- if ($scope.groupid != undefined && $scope.restype != undefined) {
- sessionStorage.groupid = $scope.groupid.toString();
- sessionStorage.restype = $scope.restype;
- }
- if ($scope.privateName == null || $scope.privateName == undefined || $scope.privateName == "") {
- if (sessionStorage.restype == "0") {
- $scope.privateName = '科创联盟入驻企业库';
- }
- if (sessionStorage.restype == "1") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '需求库';
- } else {
- $scope.privateName = 'Demands Database';
- }
- }
- if (sessionStorage.restype == "2") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '成果库';
- } else {
- $scope.privateName = 'Achievements Database';
- }
- }
- if (sessionStorage.restype == "3") {
- $scope.privateName = '政策库';
- }
- if (sessionStorage.restype == "6") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '企业库';
- } else {
- $scope.privateName = 'Enterprise Database';
- }
- }
- if (sessionStorage.restype == "7") {
- $scope.privateName = '高校库';
- }
- if (sessionStorage.restype == "8") {
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateName = '专家库';
- } else {
- $scope.privateName = 'Experts Database';
- }
- }
- if (sessionStorage.restype == "35") {
- $scope.privateName = '技术经理人库';
- }
- if (sessionStorage.restype == "36") {
- $scope.privateName = '产学研备案库库';
- }
- if (sessionStorage.restype == "38") {
- $scope.privateName = '人才库';
- }
- if (sessionStorage.restype == "39") {
- $scope.privateName = '金融库';
- }
- if (sessionStorage.restype == "40") {
- $scope.privateName = '中介库';
- }
- if (sessionStorage.restype == "41") {
- $scope.privateName = '平台库';
- }
- if (sessionStorage.restype == "43") {
- $scope.privateName = '武进区科技创新创业联盟库';
- }
- if (sessionStorage.restype == "44") {
- $scope.privateName = '创新创业联盟导师库';
- }
- if (UserService.defaultLan == 'Chinese') {
- $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 1);
- } else {
- $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 9);
- }
- }
- // 我的企业-分页
- $scope.mypages = {
- allFlag: true,
- currentPage: 0,
- pageSize: 4,
- totalPage: 0,
- totalCount: 0,
- startIndex: 0,
- sortKeys: ""
- };
- // 所有企业-分页
- $scope.allpages = {
- allFlag: true,
- currentPage: 0,
- pageSize: 4,
- totalPage: 0,
- totalCount: 0,
- startIndex: 0,
- sortKeys: ""
- };
- $scope.keyfilter = {key: ""};//搜索关键词
- var activity = ['task', 'mytask'];
- $scope.act = activity[1];//默认选择全部资源
- $scope.changeAct = function (num) {
- $scope.islogin = ConfigService.islogin;
- $scope.act = activity[num];
- if (num == 0) {
- 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 {
- // 我的企业则userid要传递
- $scope.act = activity[num];
- //TODO
- userid = UserService.id;
- // userid = 859;
- }
- } else if (num == 1) {
- $scope.act = activity[num];
- userid = 0;
- }
- };
- //虚拟搜索框
- $scope.isShowSearchButton = true;
- $scope.keyfilter = {key: ""};//搜索关键词
- $scope.showSearchButtonLeft = function () {
- $scope.isShowSearchButton = false;
- $(".showSearchInputForResLibrary").focus();
- };
- //清空搜索内容
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- };
- //TODO 放开注释
- if ($scope.app) {
- if (device.platform != "Android") {
- $scope.isIos = true;
- } else {
- $scope.isIos = false;
- }
- }
- /*{
- SortType: 0,
- classificationType: libtype,
- starType: 0,
- MaturityType: 0,
- RightType: 0,
- ModelType: 0,
- BudgetType: 0,
- ScaleType: 0,
- EnterpriseType: 0,
- DegreeType: 0,
- sexType: 0,
- TitleType: 0
- }*/
- //排序初始化
- // $scope.sorts = [
- // {name: "热门", type: 0, value: "visitcount,DESC"},
- // {name: "最新", type: 1, value: "timestamp,DESC"},
- // {name: "综合", type: 2, value: "compositescore,DESC"}
- // ];
- // var checkedsort = $scope.sorts[0].value;
- //分类初始化
- /*$scope.classification = [
- {name: "不限", type: 0},
- {name: "成果", type: 2},
- {name: "需求", type: 1},
- {name: "企业", type: 6},
- {name: "人才", type: 8}
- ];
- //地区初始化
- $scope.checkedlocationtype = 1;
- $scope.chooeslocation = [
- {name: "不限"},
- {name: "常州"},
- {name: "定位"}
- ];*/
- if ($scope.restype == 2) {
- //成熟度初始化
- $scope.chooesMaturity = [
- {name: "不限", type: 0},
- {name: "正在研发", type: 1},
- {name: "已有小样", type: 2},
- {name: "通过小试", type: 3},
- {name: "通过中试", type: 4},
- {name: "可以量产", type: 5}
- ];
- //知识产权初始化
- $scope.chooesRight = [
- {name: "不限", type: 0},
- {name: "有", type: 1},
- {name: "无", type: 2}
- ];
- //合作模式初始化
- $scope.chooesModel = [
- {name: "不限", type: 0},
- {name: "委托开发", type: 1},
- {name: "合作研发", type: 2},
- {name: "成果转让", type: 3},
- {name: "技术入股", type: 4},
- {name: "技术咨询", type: 5},
- {name: "其他", type: 6}
- ];
- } else if ($scope.restype == 1) {
- //合作模式初始化
- $scope.chooesModel = [
- {name: "不限", type: 0},
- {name: "委托开发", type: 1},
- {name: "合作研发", type: 2},
- {name: "成果转让", type: 3},
- {name: "技术入股", type: 4},
- {name: "技术咨询", type: 5},
- {name: "其他", type: 6}
- ];
- //投入预算
- $scope.inputBudget = [
- {name: "不限", type: 0},
- {name: "1000万以上", type: 9},
- {name: "500万-1000万", type: 8},
- {name: "200万-500万", type: 7},
- {name: "100万-200万", type: 6},
- {name: "50万-100万", type: 5},
- {name: "10万-50万", type: 4},
- {name: "10万以下", type: 3},
- {name: "面议", type: 2}
- ]
- } else if ($scope.restype == 6) {
- //企业规模
- $scope.enterpriseScale = [
- {name: "不限", type: 0},
- {name: "少于50人", type: 1},
- {name: "50-150人", type: 2},
- {name: "150-500人", type: 3},
- {name: "500-1000人", type: 4},
- {name: "1000-5000人", type: 5},
- {name: "5000-10000人", type: 6},
- {name: "10000人以上", type: 7}
- ];
- //企业类型
- $scope.enterpriseType = [
- {name: "不限", type: 0},
- {name: "国有企业", type: 1},
- {name: "集体所有制企业", type: 2},
- {name: "私营企业", type: 3},
- {name: "股份制企业", type: 4},
- {name: "联营企业", type: 5},
- {name: "外商投资企业", type: 6},
- {name: "港澳台企业", type: 7},
- {name: "股份合作企业", type: 8}
- ];
- $scope.starType = [
- {name: "不限", type: 0},
- {name: "是", type: 1},
- {name: "否", type: 2}
- ];
- } else if ($scope.restype == 8) {
- //学位
- $scope.academicDegree = [
- {name: "不限", type: 0},
- {name: "博士后", type: 7},
- {name: "博士", type: 6},
- {name: "硕士", type: 5},
- {name: "学士", type: 4},
- {name: "其他", type: 8}
- ];
- $scope.sexType = [
- {name: "不限", type: 0},
- {name: "男", type: 1},
- {name: "女", type: 2}
- ];
- //职称
- $scope.occupationalTitle = [
- {name: "不限", type: 0},
- {name: "正高", type: 1},
- {name: "副高", type: 2},
- {name: "中级", type: 3},
- {name: "副级", type: 4},
- {name: "无", type: 5}
- ];
- } else if ($scope.restype == 7) {
- //学校类别
- $scope.universitytype = [
- {name: "不限", type: 0},
- {name: "985工程院校暨211工程院校", type: 600},
- {name: "985工程院校", type: 601},
- {name: "211工程院校", type: 602},
- {name: "普通本科院校", type: 604},
- {name: "高职专科院校", type: 606}
- ];
- }
- // 我的企业
- $scope.contentlist = [];
- // 全部企业
- $scope.allcontentlist = [];
- // 获取排序选项列表
- var checkedsort = '';
- var getResourceSortList = function () {
- var deferred = $q.defer();
- ResourceLibraryService.getResourceSortList($stateParams.restype).then(function (res) {
- console.log('排序条件列表', res)
- if (res.code == 3350) {
- $scope.sortList = res.data[0];
- checkedsort = $stateParams.checkedsort ? $stateParams.checkedsort : '';
- if ($stateParams.checkedsort) {
- $scope.sortList.items.forEach((res) => {
- if (res.labelKey == $stateParams.checkedsort) {
- res.selected = true
- }
- })
- } else {
- // $scope.sortList.items[0] ? ($scope.sortList.items[0].selected = true) : false;
- // checkedsort = $scope.sortList.items.length > 0 ? $scope.sortList.items[0].labelKey : 'timestamp,desc';
- checkedsort = "timestamp,desc";
- if ($scope.sortList.items.length){
- $scope.sortList.items.forEach((res) => {
- if (res.labelKey == checkedsort) {
- res.selected = true
- }
- })
- }
- }
- deferred.resolve('sucess');
- }
- })
- return deferred.promise;
- };
- // 获取资源库下行业分类列表
- var getCategoryList = function () {
- /*ResourceLibraryService.getCategoryList(1001, reclibid, modlibid).then(function (response) {
- // console.log(response);
- $scope.categorylist = [{
- appModuleName: "全部",
- by1: ""
- }];
- $scope.categorylist = $scope.categorylist.concat(response.channelList);
- angular.forEach($scope.categorylist, function (value, index) {
- $scope.contentlist.push({isload: false, currentPage: 1, reslist: []});
- });
- $timeout(function () {
- $ionicSlideBoxDelegate.slide(chooseIndex);
- $scope.getPrivateResourceList();
- }, 100);
- }, function () {
- UtilService.showMess("网络不给力,请重试");
- })*/
- // 获取资源列表-全部企业
- getResourceSortList().then(function (res) {
- $scope.getAllPrivateResourceList(0);
- // 获取资源列表-我的企业
- //TODO
- // userid = 859;
- $scope.getPrivateResourceList(userid);
- })
- };
- //导出所有企业基本信息
- $scope.onexportAllOrg = function () {
- $scope.showLoadingToastUtilEnd();
- ResourceLibraryService.getexportAllOrg().then(function (res) {
- $scope.hideLoadingToast();
- var aEle = document.createElement("a");// 创建a标签
- var blob = new Blob([res], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
- aEle.download = '企业库基本信息';// 设置下载文件的文件名
- aEle.href = URL.createObjectURL(blob);
- aEle.click();// 设置点击事件
- }).catch(function (res) {
- $scope.hideLoadingToast();
- $ionicPopup.alert({
- title: '提示',
- template: "服务器错误"
- });
- })
- }
- //获取资源列表-我的企业
- $scope.getPrivateResourceList = function (id) {
- $scope.isloadingPageFloor = true;
- // $scope.showLoadingToast();
- ResourceLibraryService.getFirstResourceList(sessionStorage.restype, sessionStorage.groupid, $scope.pagenum, $scope.keyfilter.key, checkedsort, id, ConstantService.TRACE_TYPE_2619, category, $scope.labelKeys, JSON.stringify(Traverse()), $scope.capacityparams).then(function (response) {
- console.log('收藏', response);
- if ($stateParams.restype == 30) {
- angular.forEach(response.data, function (res) {
- if (!res.title) {
- dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
- if (resp.code == 3350 && resp.data.length > 0) {
- var temp = resp.data.filter(function (val) {
- return val.code == res.primTag;
- })
- if (temp.length > 0) {
- res.title = temp[0].name;
- }
- }
- }, function () {
- })
- }
- })
- }
- var tempreslib = angular.fromJson(response.data);
- $scope.mypages = angular.fromJson(response.page);
- // console.log(tempreslib);
- var temppage = angular.fromJson(response.page);
- var totalPage = Math.ceil((temppage == null ? 0 : temppage.totalCount == null ? 0 : temppage.totalCount) / 4);
- // console.log(totalPage);
- angular.forEach(tempreslib, function (val) {
- if (val.labelObj) {
- val.labelObj = val.labelObj.slice(0, 3);
- // angular.forEach(val.otherObj,function(vv){
- // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
- // })
- }
- })
- $scope.contentlist[chooseIndex].reslist = tempreslib;
- var trHtml = "<div class='refresh_tip_div'>更新了" + ($scope.contentlist[chooseIndex].reslist == null ? 0 : $scope.contentlist[chooseIndex].reslist.length == null ? 0 : $scope.contentlist[chooseIndex].reslist.length) + "条内容</div>";
- $timeout(function () {
- $(".resourcelistDiv.list").prepend(trHtml);
- $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
- }, 800);
- $timeout(function () {
- $(".refresh_tip_div").slideUp();
- }, 1200);
- //判断是否有下一页
- $timeout(function () {
- $timeout(function () {
- if ($scope.contentlist[chooseIndex].currentPage >= totalPage) {
- $scope.contentlist[chooseIndex].isload = false;
- } else {
- $scope.contentlist[chooseIndex].isload = true;
- }
- $scope.contentlist[chooseIndex].currentPage = 1;
- }, 1000);
- // $scope.hideLoadingToast();
- $ionicSlideBoxDelegate.update();
- $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
- }, 50);
- $scope.isloadingPageFloor = false;
- $scope.isloadingPageFail = false;
- $scope.isloadingPageFailAll = false;
- }, function () {
- // $scope.hideLoadingToast();
- $scope.isloadingPageFloor = false;
- $scope.isloadingPageFail = true;
- $scope.isloadingPageFailAll = false;
- }).finally(function () {
- $scope.$broadcast('scroll.refreshComplete');
- });
- };
- //加载更多资源列表-我的企业
- $scope.loadMore = function (id) {
- $scope.contentlist[chooseIndex].isload = false;
- $scope.loadmore = true;
- // $scope.showLoadingToast();
- // ResourceLibraryService.getSecondResourceList(1001, $scope.checked, checkedsort, $scope.categorylist[chooseIndex].by1, "", $scope.contentlist[chooseIndex].currentPage, reclibid).then(function (response) {
- ResourceLibraryService.getSecondResourceList(sessionStorage.restype, sessionStorage.groupid,
- $scope.contentlist[chooseIndex].currentPage, $scope.keyfilter.key, checkedsort, id, ConstantService.TRACE_TYPE_2619, category, $scope.labelKeys, JSON.stringify(Traverse()), $scope.capacityparams).then(function (response) {
- console.log('方法走了吗', response);
- // $scope.hideLoadingToast();
- if ($stateParams.moduleid == 30) {
- angular.forEach(response.data, function (res) {
- if (!res.title) {
- dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
- if (resp.code == 3350 && resp.data.length > 0) {
- var temp = resp.data.filter(function (val) {
- return val.code == res.primTag;
- })
- if (temp.length > 0) {
- res.title = temp[0].name;
- }
- }
- }, function () {
- })
- }
- })
- }
- var tempreslib = angular.fromJson(response.data);
- angular.forEach(tempreslib, function (val) {
- if (val.labelObj) {
- val.labelObj = val.labelObj.slice(0, 3);
- // angular.forEach(val.otherObj,function(vv){
- // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
- // })
- }
- })
- $scope.mypages = angular.fromJson(response.page);
- var temppage = angular.fromJson(response.page);
- var totalPage = Math.ceil(temppage.totalCount / 4);
- // console.log(totalPage);
- //加载数据,更新当前页数
- $timeout(function () {
- if (tempreslib.length > 0) {
- $scope.contentlist[chooseIndex].reslist = $scope.contentlist[chooseIndex].reslist.concat(tempreslib);
- }
- $scope.loadmore = false;
- }, 2000);
- // $scope.hideLoadingToast();
- //判断是否有下一页
- $timeout(function () {
- if ($scope.contentlist[chooseIndex].currentPage >= totalPage) {
- $scope.contentlist[chooseIndex].isload = false;
- } else {
- $scope.contentlist[chooseIndex].isload = true;
- }
- $scope.contentlist[chooseIndex].currentPage++;
- }, 2000);
- if (selectflg) {
- $timeout(function () {
- $(".item-options").addClass("invisible");
- $(".resource_wrap").css("left", "10%");
- $(".pay_list_c2").css("left", "4%");
- $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
- $("#collect-bottom").css("display", "block");
- }, 20);
- }
- }, function () {
- // $scope.hideLoadingToast();
- $scope.loadmore = false;
- }).finally(function () {
- $scope.$broadcast('scroll.infiniteScrollComplete');
- });
- };
- $scope.showManagmentSheet = function () {
- var buttonlist = [
- // {text: '导入'},
- {text: '导出'}
- ];
- $ionicActionSheet.show({
- buttons: buttonlist,
- cancelText: '取消',
- buttonClicked: function (index) {
- console.log(index)
- // if (index == 0) {
- // $scope.go("importOrgInfo", {restype: $scope.restype});
- // }
- if (index == 0) {
- $scope.showLoadingToast();
- $scope.showExportResourceClick();
- setTimeout(function () {
- $scope.showExportFlag = !$scope.showExportFlag;
- $scope.hideLoadingToast();
- }, 2000);
- return true;
- }
- }
- })
- }
- $scope.choiceExportField = function () {
- /*if (!$scope.flag && $scope.allcontentlist[0].reslist.length == 6) {
- $scope.showExportResourceClick();
- $timeout(function () {
- jumptoexportField($scope.allcontentlist[0].reslist);
- }, 1000);
- } else {
- jumptoexportField($scope.allcontentlist[0].reslist);
- }*/
- $scope.jumptoexportField($scope.allcontentlist[0].reslist);
- }
- $scope.jumptoexportField = function (reslist) {
- $scope.contenttemplist = [];
- $scope.uniquelist = [];
- angular.forEach(reslist, function (val) {
- if (val.isselected) {
- $scope.contenttemplist.push(val.resource);
- $scope.uniquelist.push(val.resource.unique);
- }
- })
- if ($scope.uniquelist.length == 0) {
- $ionicPopup.alert({
- title: '提示',
- template: "<p style='text-align: center;'>请先选择企业!</p>",
- buttons: [{text: "确定"}]
- });
- return;
- }
- $scope.go("exportField", {"reslist": $scope.contenttemplist, "uniquelist": $scope.uniquelist});
- }
- $scope.showExportFlag = true;
- $scope.showExportResourceClick = function () {
- var labelkey = "";
- angular.forEach($scope.filterList, function (filter) {
- if (filter.items[0].isselect) {
- } else {
- angular.forEach(filter.items, function (item) {
- if (item.isselect) {
- labelkey += (item.labelKey + ",");
- }
- })
- }
- }).getFirstResourceListForAll(sessionStorage.restype, sessionStorage.groupid, 0, "", "", 0, 0, "", labelkey).then(function (res) {
- console.log(res)
- if (res.code == 3350) {
- var resbackuplist = [];
- angular.forEach(res.data, function (res) {
- var temphtml = {
- resource: res,
- isselected: false
- };
- resbackuplist.push(temphtml);
- })
- $scope.allcontentlist[0].reslist = resbackuplist;
- $scope.allpages.totalCount = resbackuplist.length;
- }
- })
- }
- $scope.showFinishlick = function () {
- $scope.showExportFlag = true;
- $scope.allcontentlist[0].reslist = $scope.resbackuplist;
- }
- //全选
- $scope.flag = true;
- $scope.choiceAllResource = function () {
- if ($scope.flag) {
- angular.forEach($scope.allcontentlist[0].reslist, function (val) {
- val.isselected = true;
- })
- } else {
- angular.forEach($scope.allcontentlist[0].reslist, function (val) {
- val.isselected = false;
- })
- }
- $scope.flag = !$scope.flag;
- }
- //重新加载全部企业
- $scope.repeatLoadAll = function () {
- $scope.isloadingPageFailAll = false;
- $scope.getAllPrivateResourceList(0);
- };
- //重新加载我的企业
- $scope.repeatLoad = function () {
- $scope.isloadingPageFail = false;
- $scope.getPrivateResourceList(userid);
- };
- //获取资源列表-全部企业
- $scope.getAllPrivateResourceList = function (id) {
- $scope.isloadingPageFloor = true;
- // $scope.showLoadingToast();
- // console.log(id);
- ResourceLibraryService.getFirstResourceList(sessionStorage.restype, sessionStorage.groupid, $scope.pagenum, $scope.keyfilter.key, checkedsort, id, 0, category, $scope.labelKeys, JSON.stringify(Traverse()), $scope.capacityparams).then(function (response) {
- $scope.hideLoadingToast();
- $scope.deleteSet = new Set();
- $scope.resourceLength = response.data == null ? 0 : response.data.length;
- $scope.page = response.page
- if ($stateParams.libtype == 30) {
- angular.forEach(response.data, function (res) {
- if (!res.title) {
- dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
- if (resp.code == 3350 && resp.data.length > 0) {
- var temp = resp.data.filter(function (val) {
- return val.code == res.primTag;
- })
- if (temp.length > 0) {
- res.title = temp[0].name;
- }
- }
- }, function () {
- })
- }
- })
- }
- var tempreslib = angular.fromJson(response.data);
- angular.forEach(tempreslib, function (val) {
- if (val.labelObj) {
- val.labelObj = val.labelObj.slice(0, 3);
- // angular.forEach(val.otherObj,function(vv){
- // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
- // })
- }
- })
- $scope.allpages = angular.fromJson(response.page);
- var temppage = angular.fromJson(response.page);
- var totalPage = Math.ceil(temppage == null ? 0 : temppage.totalCount / 4);
- // console.log(totalPage);
- $scope.allcontentlist[chooseIndex].reslist = tempreslib;
- $scope.resbackuplist = $scope.allcontentlist[chooseIndex].reslist;
- var trHtml = "<div class='refresh_tip_div'>更新了" + ($scope.allcontentlist[chooseIndex].reslist == null) ? 0 : ($scope.allcontentlist[chooseIndex].reslist.length == null ? 0 : $scope.allcontentlist[chooseIndex].reslist.length) + "条内容</div>";
- $timeout(function () {
- $(".resourcelistDiv .list").prepend(trHtml);
- $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
- }, 800);
- $timeout(function () {
- $(".refresh_tip_div").slideUp();
- }, 1200);
- //判断是否有下一页
- $timeout(function () {
- $timeout(function () {
- if ($scope.allcontentlist[chooseIndex].currentPage >= totalPage) {
- $scope.allcontentlist[chooseIndex].isload = false;
- } else {
- $scope.allcontentlist[chooseIndex].isload = true;
- }
- $scope.allcontentlist[chooseIndex].currentPage = 1;
- var allcontenttemplist = [];
- angular.forEach($scope.allcontentlist[chooseIndex].reslist, function (res) {
- var temphtml = {
- resource: res,
- isselected: false
- };
- allcontenttemplist.push(temphtml);
- })
- $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
- $scope.resbackuplist = $scope.allcontentlist[chooseIndex].reslist;
- }, 0);
- $scope.hideLoadingToast();
- $ionicSlideBoxDelegate.update();
- $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
- }, 50);
- $scope.clickResource = function (resource) {
- resource.isselected = !resource.isselected;
- if (resource.isselected === true) {
- $scope.deleteSet.add(resource.resource.unique);
- }else {
- $scope.deleteSet.delete(resource.resource.unique);
- }
- console.log($scope.deleteSet);
- }
- $scope.isloadingPageFloor = false;
- $scope.isloadingPageFail = false;
- $scope.isloadingPageFailAll = false;
- }, function () {
- $scope.hideLoadingToast();
- $scope.isloadingPageFloor = false;
- $scope.isloadingPageFail = false;
- $scope.isloadingPageFailAll = true;
- }).finally(function () {
- $scope.$broadcast('scroll.refreshComplete');
- });
- };
- //分页
- $scope.handlepagination = function (currentPage) {
- $scope.deleteSet.clear();
- $scope.allcontentlist[chooseIndex].currentPage = currentPage
- $scope.showLoadingToast();
- $scope.loadMoreForAll(0)
- }
- //加载更多资源列表-全部企业
- //
- $scope.loadMoreForAll = function (id) {
- // $scope.allcontentlist[chooseIndex].isload = false;
- $scope.allloadmore = true;
- // $scope.showLoadingToast();
- // ResourceLibraryService.getSecondResourceList(1001, $scope.checked, checkedsort, $scope.categorylist[chooseIndex].by1, "", $scope.contentlist[chooseIndex].currentPage, reclibid).then(function (response) {
- ResourceLibraryService.getSecondResourceList(sessionStorage.restype, sessionStorage.groupid, $scope.allcontentlist[chooseIndex].currentPage, $scope.keyfilter.key, checkedsort, id, 0, category, $scope.labelKeys, JSON.stringify(Traverse()), $scope.capacityparams).then(function (response) {
- if ($stateParams.restype == 30) {
- angular.forEach(response.data, function (res) {
- if (!res.title) {
- dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
- if (resp.code == 3350 && resp.data.length > 0) {
- var temp = resp.data.filter(function (val) {
- return val.code == res.primTag;
- })
- if (temp.length > 0) {
- res.title = temp[0].name;
- }
- }
- }, function () {
- })
- }
- })
- }
- var tempreslib = angular.fromJson(response.data);
- angular.forEach(tempreslib, function (val) {
- if (val.labelObj) {
- val.labelObj = val.labelObj.slice(0, 3);
- // angular.forEach(val.otherObj,function(vv){
- // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
- // })
- }
- })
- $scope.allpages = angular.fromJson(response.page);
- var temppage = angular.fromJson(response.page);
- // var totalPage = Math.ceil(temppage.totalCount / 4);
- var totalPage = response.page.totalPage;
- console.log(totalPage);
- if ($scope.isapp) {
- console.log($scope.allcontentlist)
- if (tempreslib.length > 0) {
- $scope.allcontentlist[chooseIndex].reslist = $scope.allcontentlist[chooseIndex].reslist.concat(tempreslib);
- var allcontenttemplist = [];
- angular.forEach($scope.allcontentlist[chooseIndex].reslist, function (res) {
- if (res.isselected == undefined) {
- var temphtml = {
- resource: res,
- isselected: false
- };
- allcontenttemplist.push(temphtml);
- } else {
- allcontenttemplist.push(res);
- }
- })
- $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
- }
- $scope.allloadmore = false;
- // $scope.hideLoadingToast();
- //判断是否有下一页
- if ($scope.allcontentlist[chooseIndex].currentPage >= totalPage) {
- console.log(963412)
- $scope.allcontentlist[chooseIndex].isload = false;
- } else {
- $scope.allcontentlist[chooseIndex].isload = true;
- }
- $scope.$broadcast('scroll.infiniteScrollComplete');
- $scope.allcontentlist[chooseIndex].currentPage++;
- } else {
- var allcontenttemplist = [];
- angular.forEach(tempreslib, function (res) {
- if (res.isselected == undefined) {
- var temphtml = {
- resource: res,
- isselected: false
- };
- allcontenttemplist.push(temphtml);
- } else {
- allcontenttemplist.push(res);
- }
- })
- $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
- $scope.hideLoadingToast()
- console.log($scope.allcontentlist)
- }
- //加载数据,更新当前页数
- if (selectflg) {
- $timeout(function () {
- $(".item-options").addClass("invisible");
- $(".resource_wrap").css("left", "10%");
- $(".pay_list_c2").css("left", "4%");
- $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
- $("#collect-bottom").css("display", "block");
- }, 20);
- }
- }, function () {
- // $scope.hideLoadingToast();
- $scope.allloadmore = false;
- }).finally(function () {
- $scope.$broadcast('scroll.infiniteScrollComplete');
- });
- };
- getCategoryList();
- $scope.islogin = ConfigService.islogin;
- // 进入资源详情
- $scope.goResourceDetail = function (resource, ind) {
- if (!$scope.islogin && ($stateParams.restype != 30 && $stateParams.restype != 31 && $stateParams.restype != 32 &&
- $stateParams.restype != 33 && $stateParams.restype != 34)) {
- 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 {
- if (selectflg) {
- selectResource(resource, ind);
- } else {
- resourceLibraryTempData.setCategoryIndex(chooseIndex);
- resourceLibraryTempData.setChecked($scope.checked);
- if (!$scope.groupid) {
- $scope.groupid = $stateParams.groupid;
- }
- if (!$scope.restype) {
- $scope.restype = $stateParams.restype;
- }
- if (resource.groupid == "0") {
- $scope.go('resourceDetails', {
- recourceid: resource.unique,
- recourcetype: resource.type,
- recourcecomefrom: resource.source,
- title: resource.title,
- comfrom: 'privateResource',
- filterList: $scope.filterList,
- reclibid: $scope.groupid,
- moduleid: $scope.restype
- });
- } else {
- $scope.go('resourceCommonDetailsPage', {
- res: angular.toJson($stateParams.res),
- recourceid: resource.unique,
- recourcetype: resource.type,
- recourcecomefrom: resource.source,
- creator: resource.clickthrough,
- title: resource.title,
- orgtype: 0,
- comfrom: 'privateResource',
- pagecode: 0,
- label: JSON.stringify(resource.otherObj),
- filterList: $scope.filterList,
- groupid: $scope.groupid,
- restype: $scope.restype,
- privateName: $scope.privateName,
- MoreData: $scope.MoreData,
- capacityparams: $scope.capacityparams,
- checkedsort: checkedsort,
- row: JSON.stringify(resource)
- });
- }
- }
- }
- };
- var editSlide = function (index) {
- var tablength = $scope.categorylist.length;//标题个数
- var middlewidth = $(window).width() / 2;//获取当前手机屏幕宽度一般
- var OffLeft = $(".Chanel_scroll_a").eq(index).offset().left;//获取当前点击标题距离父容器左边框的距离
- var SelfWidth = $(".Chanel_scroll_a").eq(index).width();//获取当前点击标题宽度
- var startTranform = $("#p_Chanel .scroll").offset().left;
- var movewidth = OffLeft - middlewidth + SelfWidth / 2;
- startTranform -= movewidth;
- if (startTranform <= 0) {
- if (index < tablength - 2) {
- $('#p_Chanel .scroll').css({
- 'transform': 'translate3d(' + startTranform + 'px,0,0)'
- });
- }
- } else if (index < 4) {
- $('#p_Chanel .scroll').css({
- 'transform': 'translate3d(0,0,0)'
- });
- }
- $(".Chanel_scroll_a").eq(index).addClass("scroll_a_on").siblings().removeClass("scroll_a_on");
- };
- $scope.selectCategory = function (index) {
- editSlide(index);
- $(".Chanel_scroll_a").eq(index).addClass("scroll_a_on").siblings().removeClass("scroll_a_on");
- if (index == chooseIndex) {
- return;
- }
- chooseIndex = index;
- $scope.index = chooseIndex;
- $scope.getPrivateResourceList(0);
- };
- //资源库搜索
- $scope.goResourceSearch = function () {
- resourceLibraryTempData.setCategoryIndex(chooseIndex);
- resourceLibraryTempData.setChecked($scope.checked);
- //1:需求,2:成果,6:企业,8:人才
- var tabindex = 3;
- if ($scope.restype == 1) {
- tabindex = 4;
- } else if ($scope.restype == 2) {
- tabindex = 3;
- } else if ($scope.restype == 6) {
- tabindex = 5;
- } else if ($scope.restype == 8) {
- tabindex = 6;
- }
- $timeout(function () {
- $scope.go('resourceSearch', {resourcetype: 1001, restype: $scope.restype, tabindex: tabindex});
- }, 350);
- };
- $scope.shareflg = false;
- $scope.openShare = function (tempobj, ind) {
- $scope.go('chooseShareResource', {
- chereslist: angular.toJson([tempobj.unique]),
- folderid: $scope.reclibid,
- isCloud: 1,
- recourcetype: tempobj.type,
- recourcecomefrom: tempobj.source
- });
- /*$scope.shareflg = true;
- $(".resource_wrap").css("left", "0%");
- $(".pay_list_c2").css("left", "-35px");
- $("#collect-bottom").css("display", "none");
- checkedresource = tempobj;
- checkedindex = ind;*/
- };
- $scope.closeShare = function () {
- $timeout(function () {
- $ionicListDelegate.closeOptionButtons();
- }, 10);
- $scope.shareflg = false;
- };
- //选择排序
- $scope.chooseSort = function (b) {
- $scope.checked.SortType = b.type;
- checkedsort = b.value;
- };
- //选择分类
- /*$scope.chooseClassification = function (tempclass) {
- $scope.checked.classificationType = tempclass.type;
- };*/
- //地区
- /*$scope.chooseActionlocation = function (index) {
- $(".locationclassfile ul li").eq(index).addClass("specialSpan").siblings().removeClass("specialSpan");
- if (index != 0) {
- $(".locationclassfile ul li:first-child").css({"color": "#000", "border": "none"});
- } else {
- $(".locationclassfile ul li:first-child").css({"color": "#3385ff", "border": "#3385ff .5px solid"});
- $(".locationclassfile ul li").removeClass("specialSpan");
- }
- };*/
- //选择成熟度
- $scope.chooseActionMaturity = function (s) {
- $scope.checked.MaturityType = s.type;
- };
- //选择知识产产权
- $scope.chooseActionRight = function (r) {
- $scope.checked.RightType = r.type;
- };
- //选择合作模式
- $scope.chooseActionModel = function (m) {
- $scope.checked.ModelType = m.type;
- };
- //选择投入预算
- $scope.chooseInputBudget = function (budget) {
- $scope.checked.BudgetType = budget.type;
- };
- //选择企业规模
- $scope.chooseEenterpriseScale = function (scale) {
- $scope.checked.ScaleType = scale.type;
- };
- //高企
- $scope.chooseStarType = function (star) {
- $scope.checked.starType = star.type;
- };
- //选择企业类型
- $scope.chooseEnterpriseType = function (enterprise) {
- $scope.checked.EnterpriseType = enterprise.type;
- };
- //选择学位
- $scope.chooseAcademicDegree = function (degree) {
- $scope.checked.DegreeType = degree.type;
- };
- //性别
- $scope.chooseSexType = function (sex) {
- $scope.checked.sexType = sex.type;
- };
- //选择职称
- $scope.chooseOccupationalTitle = function (title) {
- $scope.checked.TitleType = title.type;
- };
- //选择学校类别
- $scope.chooseUniversityType = function (university) {
- $scope.checked.UniversityType = university.type;
- };
- //展开/收起排序
- $scope.toggleSort = function () {
- $(".sort ul").toggle();
- $(".sort h3 i").toggleClass("transformArrow");
- };
- //展开/收起分类
- /*$scope.toggleClassification = function () {
- $(".Classification ul").toggle();
- $(".Classification h3 i").toggleClass("transformArrow");
- };
- //展开/收起地区
- $scope.toggleClassfilelocation = function () {
- $(".locationclassfile ul").toggle();
- $(".locationclassfile h3 i").toggleClass("transformArrow");
- };*/
- //展开/收起成熟度
- $scope.toggleClassfileMaturity = function () {
- $(".Maturityclassfile ul").toggle();
- $(".Maturityclassfile h3 i").toggleClass("transformArrow");
- };
- //展开/收起知识产权
- $scope.toggleClassfileRight = function () {
- $(".Rightclassfile ul").toggle();
- $(".Rightclassfile h3 i").toggleClass("transformArrow");
- };
- //展开/收起合作模式
- $scope.toggleClassfileModel = function () {
- $(".Modelclassfile ul").toggle();
- $(".Modelclassfile h3 i").toggleClass("transformArrow");
- };
- //展开/收起投入预算
- $scope.toggleInputBudget = function () {
- $(".InputBudget ul").toggle();
- $(".InputBudget h3 i").toggleClass("transformArrow");
- };
- //展开/收起企业规模
- $scope.toggleEenterpriseScale = function () {
- $(".EenterpriseScale ul").toggle();
- $(".EenterpriseScale h3 i").toggleClass("transformArrow");
- };
- //展开/收起高企
- $scope.toggleStarType = function () {
- $(".StarType ul").toggle();
- $(".StarType h3 i").toggleClass("transformArrow");
- };
- //展开/收起企业类型
- $scope.toggleEnterpriseType = function () {
- $(".EnterpriseType ul").toggle();
- $(".EnterpriseType h3 i").toggleClass("transformArrow");
- };
- //展开/收起学位
- $scope.toggleAcademicDegree = function () {
- $(".AcademicDegree ul").toggle();
- $(".AcademicDegree h3 i").toggleClass("transformArrow");
- };
- //展开/收起性别
- $scope.toggleSexType = function () {
- $(".sexType ul").toggle();
- $(".sexType h3 i").toggleClass("transformArrow");
- };
- //展开/收起职称
- $scope.toggleOccupationalTitle = function () {
- $(".OccupationalTitle ul").toggle();
- $(".OccupationalTitle h3 i").toggleClass("transformArrow");
- };
- //展开/收起学校类别
- $scope.toggleUniversityType = function () {
- $(".UniversityType ul").toggle();
- $(".UniversityType h3 i").toggleClass("transformArrow");
- };
- $scope.finishShow = false;
- //展开筛选
- $scope.menueFilter = function () {
- $scope.finishShow = true;
- };
- //完成选择,刷新数据
- $scope.finishDone = function () {
- $scope.finishShow = false;
- // 获取资源列表-全部企业
- $scope.getAllPrivateResourceList(0);
- // 获取资源列表-我的企业
- //TODO
- // userid = 859;
- $scope.getPrivateResourceList(userid);
- };
- //重置选择数据
- $scope.reseChecked = function () {
- $scope.checked = {
- SortType: 0,
- classificationType: libtype,
- starType: 0,
- MaturityType: 0,
- RightType: 0,
- ModelType: 0,
- BudgetType: 0,
- ScaleType: 0,
- EnterpriseType: 0,
- DegreeType: 0,
- sexType: 0,
- TitleType: 0,
- UniversityType: 0
- };
- checkedsort = $scope.sorts[0].value;
- };
- //点击空白灰色选择条件隐藏
- $scope.hideSortDiv = function () {
- $scope.finishShow = false;
- // 获取资源列表-全部企业
- $scope.getAllPrivateResourceList(0);
- // 获取资源列表-我的企业
- //TODO
- // userid = 859;
- $scope.getPrivateResourceList(userid);
- };
- //打开操作表
- $scope.openActionSheet = function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '设置'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- if (index == 0) {
- $scope.go("authoritySet", {
- resid: res.id,
- authorityid: res.authorityid,
- authoritycomefrom: res.authoritycomefrom,
- name: res.name,
- content: res.content,
- sort: res.sort,
- goflg: 1,
- type: 1,
- groupid: res.parentid
- });
- }
- return true;
- }
- });
- };
- //分享选择操作表
- var selectflg = false;//列表选择打开标志
- $scope.openCollectShare = function () {
- selectflg = true;
- $scope.contentlist[$scope.index].reslist[checkedindex].value = true;
- var tempres = {
- infoid: checkedresource.unique,
- infocomefrom: checkedresource.source,
- infoType: checkedresource.type
- };
- $scope.checkedresourcelist.push(tempres);
- $(".item-options").addClass("invisible");
- $(".resource_wrap").css("left", "10%");
- $(".pay_list_c2").css("left", "4%");
- $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
- $("#collect-bottom").css("display", "block");
- $scope.closeShare();
- };
- //取消分享
- $scope.cancelShare = function () {
- angular.forEach($scope.contentlist[$scope.index].reslist, function (value, ind) {
- $scope.contentlist[$scope.index].reslist[ind].value = false;
- });
- $scope.checkedresourcelist = [];
- $(".resource_wrap").css("left", "0%");
- $(".pay_list_c2").css("left", "-35px");
- $("#collect-bottom").css("display", "none");
- selectflg = false;
- };
- var selectResource = function (resource, ind) {
- var tempres = {
- infoid: resource.unique,
- infocomefrom: resource.source,
- infoType: resource.type
- };
- var chind = -1;
- angular.forEach($scope.checkedresourcelist, function (value, index) {
- if (value.infoid == resource.unique) {
- chind = index;
- }
- });
- if (chind == -1) {
- $scope.contentlist[$scope.index].reslist[ind].value = true;
- $scope.checkedresourcelist.unshift(tempres);
- } else {
- $scope.contentlist[$scope.index].reslist[ind].value = false;
- $scope.checkedresourcelist.splice(chind, 1);
- }
- // console.log($scope.checkedresourcelist);
- };
- $scope.shareResourceToPrilib = function () {
- $scope.go('chooseShareResource', {
- chereslist: angular.toJson($scope.checkedresourcelist),
- reclibid: $scope.reclibid
- });
- };
- // 搜索各种资源信息
- $scope.searchResourceList = function () {
- // $scope.showLoadingToast();
- var activity = ['task', 'mytask'];
- if ($scope.act == activity[1]) {
- // 获取资源列表-全部企业
- $scope.getAllPrivateResourceList(0);
- } else if ($scope.act == activity[0]) {
- // 获取资源列表-我的企业
- $scope.getPrivateResourceList(userid);
- }
- }, function () {
- // $scope.hideLoadingToast();
- };
- //新建走访
- $scope.goEnterCompanyInfo = function (restype) {
- console.log(restype);
- if (restype == 3 || restype == 30 || restype == 31 || restype == 32 || restype == 33 || restype == 34) {
- 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 {
- if (restype == 3) {
- $scope.restype = 34;
- $stateParams.restype = 34;
- }
- if ($stateParams.restype == 30 || $stateParams.restype == 31 || $stateParams.restype == 32 ||
- $stateParams.restype == 33 || $stateParams.restype == 34) {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: moduleid,
- orgtype: moduleid == 6 ? ConstantService.UNITTYPE_10104 : moduleid == 7 ? ConstantService.UNITTYPE_10105 : 0,
- isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建
- connid: 0,
- pagecode: 1000030,
- pageTitle: '新建' + $scope.privateName.slice(0, $scope.privateName.length - 1),
- node: UserService.node,
- comfrom: 'resource'
- });
- } else {
- ResourceLibraryService.getPageId(restype).then(function (res) {
- if (res.code == 3350) {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: res.data,
- orgtype: restype == 6 || restype == 43 ? ConstantService.UNITTYPE_10104 : restype == 7 ? ConstantService.UNITTYPE_10105 : 0,
- isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建
- connid: 0,
- pagecode: 1000030,
- pageTitle: '新建' + $scope.privateName.slice(0, $scope.privateName.length),
- node: UserService.node,
- resourcetype: moduleid,
- comfrom: 'privateResource'
- });
- }
- })
- }
- }
- }
- if (restype == 44) {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: 44,
- orgtype: 10104,
- pagecode: 1000027,
- isedit: 0,
- node: UserService.node,
- pageTitle: '新建导师'
- });
- }
- if (restype == 39) {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: 39,
- orgtype: 10104,
- pagecode: 1000036,
- isedit: 0,
- node: UserService.node,
- pageTitle: '新建金融信息',
- innertype: 39
- });
- }
- };
- //假数据、添加星级、评分与评价数
- // *******不能删,加载列表需要用到********
- // 我的企业
- $scope.contentlist = [
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 5,
- commentListNum: 222,
- },
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 4.5,
- commentListNum: 102
- },
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 4,
- commentListNum: 82
- },
- {
- title: '企业B',
- ishigh: 1,
- industry: '化工',
- starNum: 3.5,
- commentListNum: 62
- },
- {
- title: '企业C',
- ishigh: 1,
- industry: '化工',
- starNum: 3,
- commentListNum: 42
- },
- {
- title: '企业D',
- ishigh: 0,
- industry: '化工',
- starNum: 2,
- commentListNum: 32
- },
- {
- title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
- ishigh: 0,
- industry: '化工',
- starNum: 1,
- commentListNum: 22
- },
- {
- title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
- ishigh: 0,
- industry: '化工',
- starNum: 0,
- commentListNum: 12
- }
- ];
- // 全部企业
- $scope.allcontentlist = [
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 5,
- commentListNum: 222,
- },
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 4.5,
- commentListNum: 102
- },
- {
- title: '企业A',
- ishigh: 1,
- industry: '化工',
- starNum: 4,
- commentListNum: 82
- },
- {
- title: '企业B',
- ishigh: 1,
- industry: '化工',
- starNum: 3.5,
- commentListNum: 62
- },
- {
- title: '企业C',
- ishigh: 1,
- industry: '化工',
- starNum: 3,
- commentListNum: 42
- },
- {
- title: '企业D',
- ishigh: 0,
- industry: '化工',
- starNum: 2,
- commentListNum: 32
- },
- {
- title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
- ishigh: 0,
- industry: '化工',
- starNum: 1,
- commentListNum: 22
- },
- {
- title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
- ishigh: 0,
- industry: '化工',
- starNum: 0,
- commentListNum: 12
- }
- ]
- $scope.editItem = function () {
- console.log(1);
- }
- $scope.deletItem = function (id, node, idx) {
- let deleteList = [];
- if (id){
- deleteList.push(id);
- }else {
- deleteList = Array.from($scope.deleteSet);
- }
- console.log(deleteList);
- $ionicPopup.confirm({
- title: '删除确认',
- template: '请确认是否要删除!',
- cancelText: '取消',
- okText: '确认',
- }).then(function (res) {
- if (res) {
- dataToolsService.deleteresource(deleteList).then(function (res) {
- console.log(res)
- if (res.code == 3350) {
- if ($scope.app) {
- UtilService.showMess('删除成功');
- } else {
- CommonService.showMessage('删除成功', $scope);
- }
- if ($scope.act == activity[1]) {
- // setTimeout(()=>{
- // $scope.getAllPrivateResourceList(0);
- // },1000)
- // 获取资源列表-全部企业
- $scope.getAllPrivateResourceList(0);
- } else if ($scope.act == activity[0]) {
- // 获取资源列表-我的企业
- $scope.getPrivateResourceList(userid);
- }
- } else {
- if ($scope.app) {
- UtilService.showMess('删除失败');
- } else {
- CommonService.showMessage('删除失败', $scope);
- }
- }
- })
- } else {
- // console.log('You are not sure');
- }
- });
- }
- // 筛选条件页面
- $ionicModal.fromTemplateUrl('./modules/common/views/filterPage.html', {
- scope: $scope,
- animation: 'slide-in-left'
- }).then(function (modal) {
- $scope.filterPageModal = modal;
- });
- $ionicModal.fromTemplateUrl('./modules/common/views/filterPagetl.html', {
- scope: $scope,
- }).then(function (modal) {
- $scope.filtertlPageModaltl = modal;
- });
- $scope.showSideBar = function () {
- $scope.filterPageModal.show();
- }
- // $scope.taskTypeList =
- // {
- // title: '需求类型',
- // items: [
- // {labelName: '全部', labelKey: 0, selected: true},
- // {labelName: '技术需求', labelKey: 5350, selected: false},
- // {labelName: '人才需求', labelKey: 5351, selected: false},
- // {labelName: '投融资需求', labelKey: 5353, selected: false},
- // {labelName: '其他', labelKey: 5354, selected: false},
- // ]
- // }
- if ($scope.filterList == null || $scope.filterList.length == 0) {
- $scope.filterList = [];
- }
- $scope.showFilter = false;
- if ($scope.filterList == null || $scope.filterList.length == 0) {
- ResourceLibraryService.getFilterList(sessionStorage.restype).then(function (res) {
- console.log(res);
- if (res.code == 3350 && res.data.length > 0) {
- $scope.showFilter = true;
- $scope.filterList = res.data;
- angular.forEach($scope.filterList, function (val) {
- if (val.title != '国高' && val.title != '规上' && val.title != '潜力库') {
- val.items.unshift({
- labelName: '全部',
- labelKey: 88888888,
- 'isselect': true,
- selected: true
- });
- }
- })
- }
- })
- }
- $scope.changSelected = function (item, outerIndex, index) {
- console.log(item, outerIndex, index, $scope.privateName, $scope.filterList)
- // if($scope.privateName=='成果库'){
- angular.forEach($scope.filterList, function (val1) {
- angular.forEach(val1.items, function (val2) {
- val2.selected = false;
- val2.isselect = false;
- })
- })
- item.selected = !item.selected;
- item.isselect = !item.isselect;
- // }
- // else {
- // item.selected = !item.selected;
- // item.isselect = !item.isselect;
- // angular.forEach($scope.filterList, function (val1) {
- // angular.forEach(val1.items, function (val2) {
- // if (val2.labelName == item.labelName && item.isselect && item.labelName != "全部") {
- // val1.items[0].selected = false;
- // val1.items[0].isselect = false;
- // }
- // if(item.labelName == "全部"&&val2.labelName!='全部'){
- // val2.selected = false;
- // val2.isselect = false;
- // }
- // })
- // })
- // }
- }
- $scope.removeResourceByItems = function (item) {
- item.selected = !item.selected;
- item.isselect = !item.isselect;
- $scope.submitSelected();
- }
- $scope.resetSelected = function () {
- angular.forEach($scope.filterList, function (val) {
- angular.forEach(val.items, function (value, index) {
- value.selected = index == 0;
- })
- })
- angular.forEach($scope.sortList.items, function (value, index) {
- value.selected = index == 0;
- })
- $scope.labelKeys = '';
- //重新加载全部企业
- /*$scope.showLoadingToast();
- $scope.repeatLoadAll();
- $scope.repeatLoad();*/
- $scope.selectBySort(0);
- // $scope.filterList.key='';
- // $scope.currentnode=UserService.node;
- // if ($scope.act == 'task') {
- // if(!$scope.islogin){
- // }else{
- // //TODO
- // getMyData(0).then(function(data){
- // $scope.reportCompanyList=data;
- // })
- // }
- // } else if ($scope.act == 'mytask') {
- // getData(1).then(function(data){
- // $scope.reportCompanyList=data;
- // });
- // }
- }
- $scope.submitSelected = function () {
- if ($scope.selectif != 6 && $scope.node == '330122000' && $scope.privateName == '企业库') {
- /* 页面筛选不展示,以下代码注释 */
- // if ($scope.filterList.length && $scope.filterList[2].items.length > 0) {
- // $scope.filterList[2].items.forEach((res) => {
- // res.selected = false
- // })
- // $scope.capacityparams = '0'
- // }
- }
- $scope.labelKeys = '';
- angular.forEach($scope.filterList, function (val) {
- angular.forEach(val.items, function (value) {
- if (value.selected && value.labelName != '全部' && val.title != '潜力库') {
- $scope.labelKeys += value.labelKey + ',';
- }
- })
- });
- //重新加载全部企业
- $scope.showLoadingToast();
- $scope.repeatLoadAll();
- $scope.repeatLoad();
- if ($scope.node == '330122000') {
- $scope.filtertlPageModaltl.hide();
- } else {
- $scope.filterPageModal.hide();
- }
- }
- //桐庐筛选重置
- $scope.resetSelectedtl = function () {
- if ($scope.selectif == 5 || $scope.selectif == 6) {
- $scope.MoreData.forEach(function (res) {
- res.ifshow = false
- res.content1 = ""
- res.content2 = ""
- if (res.choicetype == "dropdown/number" || res.choicetype == "number1") {
- res.content3 = "请选择"
- } else {
- res.content3 = ""
- }
- })
- }
- if ($scope.selectif < 5) {
- $scope.selectindex.items.forEach((res, index) => {
- if (res.labelName == '全部') {
- res.selected = true
- } else {
- res.selected = false
- }
- })
- }
- if ($scope.selectif == 6) {
- angular.forEach($scope.filterList, function (val) {
- if (val.title != '潜力库') {
- // val.items.forEach((res) => {
- // if (res.labelName == '全部') {
- // res.selected = true
- // } else {
- // res.selected = false
- // }
- // })
- }
- });
- $scope.labelKeys = '0'
- }
- }
- //选择框回调
- $scope.handletypes = function (item, index) {
- $scope.MoreData[index].content3 = item
- }
- $scope.optclcick = function (item) {
- }
- //处理数据
- function Traverse() {
- let data = {}
- if (!$scope.MoreData) {
- return 0
- }
- $scope.MoreData.forEach((res) => {
- if ((res.content3 != '请选择' && res.content1 && res.content2 && res.content3) || (res.propertytoes == "highidentificationdate" && res.content3 != '请选择' && res.content3)) {
- data[res.propertytoes] = res.content3 + ""
- }
- if (res.content1 && res.content2) {
- if (!res.content3) {
- data[res.propertytoes] = res.content1
- } else {
- data[res.propertytoes] += "," + res.content1
- }
- data[res.propertytoes] += "," + res.content2
- }
- if (res.choicetype == 'text') {
- data[res.propertytoes] = res.content1
- }
- if (res.ifshow) {
- data[res.propertytoes] = res.value
- }
- if (res.choicetype == 'dropdown') {
- res.items.forEach((optres) => {
- if (optres.content1) {
- if (data[res.propertytoes]) {
- data[res.propertytoes] += "," + optres.value
- } else {
- data[res.propertytoes] = optres.value
- }
- }
- })
- }
- })
- if (Object.keys(data).length == 0) {
- return 0
- } else {
- return data
- }
- }
- if ($stateParams.MoreData) {
- console.log($stateParams.MoreData)
- $scope.MoreData = $stateParams.MoreData
- } else {
- ResourceLibraryService.getMorefilters($stateParams.restype).then(function (res) {
- console.log(res)
- if (res.code == 3350) {
- $scope.MoreData = res.data
- $scope.MoreData.forEach(function (res) {
- res.ifshow = false
- if (res.choicetype == "dropdown/number" || res.choicetype == "number1") {
- res.content3 = "请选择"
- }
- })
- }
- })
- }
- //筛选
- $scope.selectclick = function (item, index) {
- console.log(index)
- $scope.selectindex = item
- $scope.filtertlPageModaltl.show();
- $scope.selectif = index
- }
- var myDate = new Date();
- var startYear = 2018;//起始年份
- var endYear = myDate.getFullYear();//结束年份
- $scope.Datedata = ["请选择"]
- for (var i = startYear; i < endYear; i++) {
- $scope.Datedata.push(i)
- }
- $scope.selectByLabeltl = function (item, outerIndex, index) {
- $scope.selectindex.items.forEach((res) => {
- if (item.labelName == '全部') {
- res.selected = false
- } else {
- if (res.labelName == '全部') {
- res.selected = false
- }
- }
- })
- item.selected = !item.selected
- }
- $scope.selectByLabel = function (item, outerIndex, index) {
- $scope.flag = true;
- $scope.contentlist[chooseIndex].reslist = [];
- $scope.allcontentlist[chooseIndex].reslist = [];
- $scope.changSelected(item, outerIndex, index);
- if (!$scope.showExportFlag) {
- $scope.showExportResourceClick();
- } else {
- $scope.submitSelected();
- }
- }
- $scope.changSelectedSort = function (index) {
- angular.forEach($scope.sortList.items, function (val) {
- val.selected = false;
- })
- $scope.sortList.items[index].selected = true;
- }
- // $scope.changSelectedList = function (index) {
- // angular.forEach($scope.typeList, function (val) {
- // val.selected = false;
- // })
- // $scope.typeList[index].selected = true;
- // }
- // $scope.changSelectedTaskType = function (index) {
- // angular.forEach($scope.taskTypeList.items, function (val) {
- // val.selected = false;
- // })
- // $scope.taskTypeList.items[index].selected = true;
- //
- // }
- $scope.selectdive = function (item, index, type) {
- console.log(item)
- $scope.filterList.forEach((res1, index1) => {
- if (type) {
- if (index != index1) {
- res1.items.forEach((res2, index2) => {
- res2.selected = false
- })
- }
- } else {
- res1.items.forEach((res2, index2) => {
- if (index != index2 || res1.title != '潜力库') {
- res2.selected = false
- }
- })
- }
- })
- item.selected = !item.selected
- if (item.selected) {
- $scope.capacityparams = item.labelKey
- } else {
- $scope.capacityparams = '0'
- }
- $scope.selectif = 6
- $scope.resetSelectedtl()
- $scope.submitSelected()
- }
- $scope.selectBySort = function (index) {
- $scope.contentlist[chooseIndex].reslist = [];
- $scope.allcontentlist[chooseIndex].reslist = [];
- checkedsort = $scope.sortList.items[index].labelKey;
- $scope.changSelectedSort(index);
- $scope.submitSelected();
- }
- // $scope.selectByList = function (index) {
- // $scope.contentlist[chooseIndex].reslist = [];
- // $scope.allcontentlist[chooseIndex].reslist = [];
- // $scope.changSelectedList(index);
- // $scope.submitSelected();
- // }
- // $scope.selectByTaskType = function (index) {
- // $scope.contentlist[chooseIndex].reslist = [];
- // $scope.allcontentlist[chooseIndex].reslist = [];
- // checkedsort = $scope.taskTypeList.items[index].labelKey;
- // $scope.changSelectedTaskType(index);
- // $scope.submitSelected();
- // }
- // 设置置顶
- $scope.changeStickTop = function (type, resid) {
- console.log(resid);
- if (type) {
- ResourceLibraryService.cancelStickTop(resid).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.contentlist[chooseIndex].reslist = [];
- $scope.allcontentlist[chooseIndex].reslist = [];
- $scope.submitSelected();
- }
- })
- } else {
- ResourceLibraryService.stickTop(resid).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.contentlist[chooseIndex].reslist = [];
- $scope.allcontentlist[chooseIndex].reslist = [];
- $scope.submitSelected();
- }
- })
- }
- }
- $scope.goNewNotification = function () {
- $scope.go("notification");
- }
- })
- ;
|