privateResourceCtrl.js 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228
  1. angular.module('push')
  2. .controller('privateResourceCtrl', function ($q, $scope, $ionicActionSheet, $ionicHistory, $ionicSlideBoxDelegate, ResourceLibraryService, $stateParams, $timeout, $ionicScrollDelegate,
  3. UtilService, $ionicPopup, resourceLibraryTempData, $ionicListDelegate, AuthorityService,
  4. UserService, taskModuleService, ConfigService, ActivityService, ConstantService, dataToolsService, CommonService, $ionicModal) {
  5. //TODO
  6. if ($scope.app) {
  7. $scope.setStatusBar(1);
  8. }
  9. $scope.defaultLan = UserService.defaultLan;
  10. $scope.isWeb = !$scope.isapp;
  11. $scope.labelKeys = '';
  12. // $scope.comfromWeb=sessionStorage.comfrom=='web';
  13. // sessionStorage.comfrom='';
  14. console.log($stateParams);
  15. $scope.privateName = $stateParams.privateName
  16. $scope.node = UserService.node;
  17. $scope.deleteSet = new Set();
  18. $scope.Connections = [
  19. {restype: '2', url: 'https://www.51jishu.com/result', name: '成果大厅'},
  20. {
  21. restype: '8',
  22. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/searchExpert',
  23. name: '专家大厅'
  24. },
  25. {
  26. restype: '3',
  27. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/newPolicy?dataType=3',
  28. name: '政策扶持'
  29. },
  30. {restype: '40', url: 'https://12348.sft.zj.gov.cn/main/index/', name: '法律咨询'},
  31. {restype: '40', url: 'http://app.gjzwfw.gov.cn/jmopen/webapp/html5/swsxxcx/index.html', name: '会计咨询'},
  32. {restype: '40', url: 'http://zhejiang.chinatax.gov.cn/col/col13316/index.html', name: '税务咨询'},
  33. {restype: '40', url: 'https://zscqyjs.zjamr.zj.gov.cn/api/othing/cms/fwjg/1/0/0.html', name: '专利咨询'},
  34. {restype: '40', url: 'https://jg.sac.net.cn/pages/publicity/securities-list.html', name: '券商咨询'},
  35. {restype: '39', url: 'https://www.hzjrzhfw.com/home/index', name: '银行贷款'},
  36. {
  37. restype: '39',
  38. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/technologyFinance',
  39. name: '科技金融'
  40. },
  41. {
  42. restype: '41',
  43. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/makerSpace',
  44. name: '众创空间'
  45. },
  46. {
  47. restype: '41',
  48. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/incubator',
  49. name: '孵化器'
  50. },
  51. {
  52. restype: '41',
  53. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/comprehensive',
  54. name: '服务F综合体'
  55. },
  56. {
  57. restype: '42',
  58. url: 'https://sti.kj.hangzhou.gov.cn:9443/technology-brain-web/searchList/handle',
  59. name: '项目申报'
  60. },
  61. ]
  62. $scope.jumyclick = function (url) {
  63. console.log(url)
  64. window.open(url)
  65. }
  66. $scope.field = ['enterprisequalification', 'usertask_type', 'cooperationmodel', 'proficiency', 'cooperationmodel'];
  67. $scope.genre = ["category"];
  68. var category = $stateParams.category;
  69. $scope.authority = false;
  70. $scope.authority = $stateParams.authority == 'true';
  71. if ($stateParams.restype == 3 || $stateParams.restype == 30 || $stateParams.restype == 31 ||
  72. $stateParams.restype == 32 || $stateParams.restype == 33 || $stateParams.restype == 34) {
  73. $scope.canDelete = $stateParams.authority == 'true';
  74. }
  75. $scope.hasAuth = false;
  76. ResourceLibraryService.judgeManager(UserService.id, 10501).then(function (res) {
  77. // console.log(res);
  78. $scope.hasAuth = res.data;
  79. })
  80. taskModuleService.thisUserIsAdmin().then(function (res) {
  81. if (res.code == 3350) {
  82. $scope.isAdmin = res.data;
  83. }
  84. })
  85. $stateParams.capacityparams ? $scope.capacityparams = $stateParams.capacityparams : ''
  86. $scope.filterList = $stateParams.filterList;
  87. //加载等待页
  88. $scope.isloadingPageFloor = false;
  89. //全部企业加载失败页
  90. $scope.isloadingPageFailAll = false;
  91. //我的企业加载失败页
  92. $scope.isloadingPageFail = false;
  93. // console.log($stateParams);
  94. //1:需求,2:成果,6:企业,8:人才
  95. var res = angular.fromJson($stateParams.res);
  96. //TODO
  97. $scope.groupid = $stateParams.groupid;// 资源库文件夹id
  98. $scope.restype = $stateParams.restype;// 资源库类别
  99. var pagenum = $scope.pagenum = 0;// 索引库分页索引值,默认第一页:0
  100. var userid = $scope.userid = UserService.id;//查询时需的用户id
  101. $scope.keyfilter = {
  102. key: ""// 搜索关键词
  103. }
  104. $scope.name = res.name;
  105. // console.log(reclib.parentid,reclib.moduleid,$scope.modlibid,$scope.libtype,$scope.name);
  106. // 需求库名称
  107. $scope.privateName = $stateParams.privateName;
  108. // 我的XX/全部XX XX→需求、成果
  109. $scope.privateContent = $stateParams.privateContent;
  110. var checkedresource = {};//单个分享时选中的资源
  111. var checkedindex = -1;//多个分享时第一个选择的索引
  112. $scope.checkedresourcelist = [];//多个分享时选中的资源
  113. //拼凑筛选条件
  114. if (!$scope.labelKeys || $scope.labelKeys == "") {
  115. $scope.labelKeys = "";
  116. angular.forEach($scope.filterList, function (res) {
  117. if (res.title != '潜力库') {
  118. angular.forEach(res.items, function (item) {
  119. if (item.selected && item.labelName != '全部') {
  120. $scope.labelKeys += item.labelKey + ",";
  121. }
  122. })
  123. }
  124. })
  125. }
  126. $scope.tabs = [];
  127. var chooseIndex = resourceLibraryTempData.getCategoryIndex();//当前频道索引
  128. $scope.index = chooseIndex;
  129. $scope.checked = resourceLibraryTempData.getChecked();
  130. $scope.checked.classificationType = $scope.restype;
  131. // $scope.goback = function () {
  132. // if (UserService.node == 320481000) {
  133. // $scope.go("tab.activityIndex");
  134. // } else {
  135. // $scope.go("tab.resourceLibrary");
  136. // }
  137. // }
  138. $scope.goback = function () {
  139. $scope.go("tab.activityIndex");
  140. }
  141. //通过浏览器地址栏里面的参数来获取moduleid和restype
  142. var href = window.location.href;
  143. var splitArr = href.split('privateResource');
  144. if (splitArr.length >= 2) {
  145. console.log(splitArr)
  146. //重写返回功能
  147. $scope.goback = function () {
  148. $scope.go("tab.activityIndex");
  149. }
  150. var split = splitArr[1].split('/');
  151. if (split.length >= 2) {
  152. $scope.groupid = split[1];
  153. $scope.restype = split[2];
  154. if (sessionStorage.restype == "0") {
  155. $scope.privateName = '科创联盟入驻企业库';
  156. }
  157. if (sessionStorage.restype == "1") {
  158. if (UserService.defaultLan == 'Chinese') {
  159. $scope.privateName = '需求库';
  160. } else {
  161. $scope.privateName = 'Demands Database';
  162. }
  163. }
  164. if (sessionStorage.restype == "2") {
  165. if (UserService.defaultLan == 'Chinese') {
  166. $scope.privateName = '成果库';
  167. } else {
  168. $scope.privateName = 'Achievements Database';
  169. }
  170. }
  171. if (sessionStorage.restype == "3") {
  172. $scope.privateName = '政策库';
  173. }
  174. if (sessionStorage.restype == "6") {
  175. if (UserService.defaultLan == 'Chinese') {
  176. $scope.privateName = '企业库';
  177. } else {
  178. $scope.privateName = 'Enterprise Database';
  179. }
  180. }
  181. if (sessionStorage.restype == "7") {
  182. $scope.privateName = '高校库';
  183. }
  184. if (sessionStorage.restype == "8") {
  185. if (UserService.defaultLan == 'Chinese') {
  186. $scope.privateName = '专家库';
  187. } else {
  188. $scope.privateName = 'Experts Database';
  189. }
  190. }
  191. if (sessionStorage.restype == "35") {
  192. $scope.privateName = '技术经理人库';
  193. }
  194. if (sessionStorage.restype == "36") {
  195. $scope.privateName = '产学研备案库库';
  196. }
  197. if (sessionStorage.restype == "38") {
  198. $scope.privateName = '人才库';
  199. }
  200. if (sessionStorage.restype == "39") {
  201. $scope.privateName = '金融库';
  202. }
  203. if (sessionStorage.restype == "40") {
  204. $scope.privateName = '中介库';
  205. }
  206. if (sessionStorage.restype == "41") {
  207. $scope.privateName = '平台库';
  208. }
  209. if (sessionStorage.restype == "43") {
  210. $scope.privateName = '武进区科技创新创业联盟库';
  211. }
  212. if (sessionStorage.restype == "44") {
  213. $scope.privateName = '创新创业联盟导师库';
  214. }
  215. if (UserService.defaultLan == 'Chinese') {
  216. $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 1);
  217. } else {
  218. $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 9);
  219. }
  220. }
  221. }
  222. if ($scope.groupid != undefined && $scope.restype != undefined) {
  223. sessionStorage.groupid = $scope.groupid.toString();
  224. sessionStorage.restype = $scope.restype;
  225. }
  226. if ($scope.privateName == null || $scope.privateName == undefined || $scope.privateName == "") {
  227. if (sessionStorage.restype == "0") {
  228. $scope.privateName = '科创联盟入驻企业库';
  229. }
  230. if (sessionStorage.restype == "1") {
  231. if (UserService.defaultLan == 'Chinese') {
  232. $scope.privateName = '需求库';
  233. } else {
  234. $scope.privateName = 'Demands Database';
  235. }
  236. }
  237. if (sessionStorage.restype == "2") {
  238. if (UserService.defaultLan == 'Chinese') {
  239. $scope.privateName = '成果库';
  240. } else {
  241. $scope.privateName = 'Achievements Database';
  242. }
  243. }
  244. if (sessionStorage.restype == "3") {
  245. $scope.privateName = '政策库';
  246. }
  247. if (sessionStorage.restype == "6") {
  248. if (UserService.defaultLan == 'Chinese') {
  249. $scope.privateName = '企业库';
  250. } else {
  251. $scope.privateName = 'Enterprise Database';
  252. }
  253. }
  254. if (sessionStorage.restype == "7") {
  255. $scope.privateName = '高校库';
  256. }
  257. if (sessionStorage.restype == "8") {
  258. if (UserService.defaultLan == 'Chinese') {
  259. $scope.privateName = '专家库';
  260. } else {
  261. $scope.privateName = 'Experts Database';
  262. }
  263. }
  264. if (sessionStorage.restype == "35") {
  265. $scope.privateName = '技术经理人库';
  266. }
  267. if (sessionStorage.restype == "36") {
  268. $scope.privateName = '产学研备案库库';
  269. }
  270. if (sessionStorage.restype == "38") {
  271. $scope.privateName = '人才库';
  272. }
  273. if (sessionStorage.restype == "39") {
  274. $scope.privateName = '金融库';
  275. }
  276. if (sessionStorage.restype == "40") {
  277. $scope.privateName = '中介库';
  278. }
  279. if (sessionStorage.restype == "41") {
  280. $scope.privateName = '平台库';
  281. }
  282. if (sessionStorage.restype == "43") {
  283. $scope.privateName = '武进区科技创新创业联盟库';
  284. }
  285. if (sessionStorage.restype == "44") {
  286. $scope.privateName = '创新创业联盟导师库';
  287. }
  288. if (UserService.defaultLan == 'Chinese') {
  289. $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 1);
  290. } else {
  291. $scope.privateContent = $scope.privateName.substring(0, $scope.privateName.length - 9);
  292. }
  293. }
  294. // 我的企业-分页
  295. $scope.mypages = {
  296. allFlag: true,
  297. currentPage: 0,
  298. pageSize: 4,
  299. totalPage: 0,
  300. totalCount: 0,
  301. startIndex: 0,
  302. sortKeys: ""
  303. };
  304. // 所有企业-分页
  305. $scope.allpages = {
  306. allFlag: true,
  307. currentPage: 0,
  308. pageSize: 4,
  309. totalPage: 0,
  310. totalCount: 0,
  311. startIndex: 0,
  312. sortKeys: ""
  313. };
  314. $scope.keyfilter = {key: ""};//搜索关键词
  315. var activity = ['task', 'mytask'];
  316. $scope.act = activity[1];//默认选择全部资源
  317. $scope.changeAct = function (num) {
  318. $scope.islogin = ConfigService.islogin;
  319. $scope.act = activity[num];
  320. if (num == 0) {
  321. if (!$scope.islogin) {
  322. if (localStorage.wxFlag == "true") {
  323. if (localStorage.isUserFocusXW == 0) {
  324. var title = localStorage.appidStr;
  325. $ionicPopup.alert({
  326. title: '提示',
  327. template: '请先关注微信公众号"' + title + '"!'
  328. });
  329. return;
  330. } else {
  331. if (localStorage.isUserBindWx == 0) {
  332. var wxFlag = JSON.parse(localStorage.params);
  333. if (wxFlag.weChatModel) {
  334. $scope.go('bindPhone', {
  335. params: localStorage.params,
  336. comfrom: 'maincontroller',
  337. url: window.location.href.split('#/')[1]
  338. });
  339. } else {
  340. $scope.go('login');
  341. return;
  342. }
  343. } else {
  344. $scope.go('login');
  345. return;
  346. }
  347. }
  348. } else {
  349. $scope.go('login');
  350. return;
  351. }
  352. } else {
  353. // 我的企业则userid要传递
  354. $scope.act = activity[num];
  355. //TODO
  356. userid = UserService.id;
  357. // userid = 859;
  358. }
  359. } else if (num == 1) {
  360. $scope.act = activity[num];
  361. userid = 0;
  362. }
  363. };
  364. //虚拟搜索框
  365. $scope.isShowSearchButton = true;
  366. $scope.keyfilter = {key: ""};//搜索关键词
  367. $scope.showSearchButtonLeft = function () {
  368. $scope.isShowSearchButton = false;
  369. $(".showSearchInputForResLibrary").focus();
  370. };
  371. //清空搜索内容
  372. $scope.clearSearch = function () {
  373. $scope.isShowSearchButton = true;
  374. $scope.keyfilter.key = "";
  375. };
  376. //TODO 放开注释
  377. if ($scope.app) {
  378. if (device.platform != "Android") {
  379. $scope.isIos = true;
  380. } else {
  381. $scope.isIos = false;
  382. }
  383. }
  384. /*{
  385. SortType: 0,
  386. classificationType: libtype,
  387. starType: 0,
  388. MaturityType: 0,
  389. RightType: 0,
  390. ModelType: 0,
  391. BudgetType: 0,
  392. ScaleType: 0,
  393. EnterpriseType: 0,
  394. DegreeType: 0,
  395. sexType: 0,
  396. TitleType: 0
  397. }*/
  398. //排序初始化
  399. // $scope.sorts = [
  400. // {name: "热门", type: 0, value: "visitcount,DESC"},
  401. // {name: "最新", type: 1, value: "timestamp,DESC"},
  402. // {name: "综合", type: 2, value: "compositescore,DESC"}
  403. // ];
  404. // var checkedsort = $scope.sorts[0].value;
  405. //分类初始化
  406. /*$scope.classification = [
  407. {name: "不限", type: 0},
  408. {name: "成果", type: 2},
  409. {name: "需求", type: 1},
  410. {name: "企业", type: 6},
  411. {name: "人才", type: 8}
  412. ];
  413. //地区初始化
  414. $scope.checkedlocationtype = 1;
  415. $scope.chooeslocation = [
  416. {name: "不限"},
  417. {name: "常州"},
  418. {name: "定位"}
  419. ];*/
  420. if ($scope.restype == 2) {
  421. //成熟度初始化
  422. $scope.chooesMaturity = [
  423. {name: "不限", type: 0},
  424. {name: "正在研发", type: 1},
  425. {name: "已有小样", type: 2},
  426. {name: "通过小试", type: 3},
  427. {name: "通过中试", type: 4},
  428. {name: "可以量产", type: 5}
  429. ];
  430. //知识产权初始化
  431. $scope.chooesRight = [
  432. {name: "不限", type: 0},
  433. {name: "有", type: 1},
  434. {name: "无", type: 2}
  435. ];
  436. //合作模式初始化
  437. $scope.chooesModel = [
  438. {name: "不限", type: 0},
  439. {name: "委托开发", type: 1},
  440. {name: "合作研发", type: 2},
  441. {name: "成果转让", type: 3},
  442. {name: "技术入股", type: 4},
  443. {name: "技术咨询", type: 5},
  444. {name: "其他", type: 6}
  445. ];
  446. } else if ($scope.restype == 1) {
  447. //合作模式初始化
  448. $scope.chooesModel = [
  449. {name: "不限", type: 0},
  450. {name: "委托开发", type: 1},
  451. {name: "合作研发", type: 2},
  452. {name: "成果转让", type: 3},
  453. {name: "技术入股", type: 4},
  454. {name: "技术咨询", type: 5},
  455. {name: "其他", type: 6}
  456. ];
  457. //投入预算
  458. $scope.inputBudget = [
  459. {name: "不限", type: 0},
  460. {name: "1000万以上", type: 9},
  461. {name: "500万-1000万", type: 8},
  462. {name: "200万-500万", type: 7},
  463. {name: "100万-200万", type: 6},
  464. {name: "50万-100万", type: 5},
  465. {name: "10万-50万", type: 4},
  466. {name: "10万以下", type: 3},
  467. {name: "面议", type: 2}
  468. ]
  469. } else if ($scope.restype == 6) {
  470. //企业规模
  471. $scope.enterpriseScale = [
  472. {name: "不限", type: 0},
  473. {name: "少于50人", type: 1},
  474. {name: "50-150人", type: 2},
  475. {name: "150-500人", type: 3},
  476. {name: "500-1000人", type: 4},
  477. {name: "1000-5000人", type: 5},
  478. {name: "5000-10000人", type: 6},
  479. {name: "10000人以上", type: 7}
  480. ];
  481. //企业类型
  482. $scope.enterpriseType = [
  483. {name: "不限", type: 0},
  484. {name: "国有企业", type: 1},
  485. {name: "集体所有制企业", type: 2},
  486. {name: "私营企业", type: 3},
  487. {name: "股份制企业", type: 4},
  488. {name: "联营企业", type: 5},
  489. {name: "外商投资企业", type: 6},
  490. {name: "港澳台企业", type: 7},
  491. {name: "股份合作企业", type: 8}
  492. ];
  493. $scope.starType = [
  494. {name: "不限", type: 0},
  495. {name: "是", type: 1},
  496. {name: "否", type: 2}
  497. ];
  498. } else if ($scope.restype == 8) {
  499. //学位
  500. $scope.academicDegree = [
  501. {name: "不限", type: 0},
  502. {name: "博士后", type: 7},
  503. {name: "博士", type: 6},
  504. {name: "硕士", type: 5},
  505. {name: "学士", type: 4},
  506. {name: "其他", type: 8}
  507. ];
  508. $scope.sexType = [
  509. {name: "不限", type: 0},
  510. {name: "男", type: 1},
  511. {name: "女", type: 2}
  512. ];
  513. //职称
  514. $scope.occupationalTitle = [
  515. {name: "不限", type: 0},
  516. {name: "正高", type: 1},
  517. {name: "副高", type: 2},
  518. {name: "中级", type: 3},
  519. {name: "副级", type: 4},
  520. {name: "无", type: 5}
  521. ];
  522. } else if ($scope.restype == 7) {
  523. //学校类别
  524. $scope.universitytype = [
  525. {name: "不限", type: 0},
  526. {name: "985工程院校暨211工程院校", type: 600},
  527. {name: "985工程院校", type: 601},
  528. {name: "211工程院校", type: 602},
  529. {name: "普通本科院校", type: 604},
  530. {name: "高职专科院校", type: 606}
  531. ];
  532. }
  533. // 我的企业
  534. $scope.contentlist = [];
  535. // 全部企业
  536. $scope.allcontentlist = [];
  537. // 获取排序选项列表
  538. var checkedsort = '';
  539. var getResourceSortList = function () {
  540. var deferred = $q.defer();
  541. ResourceLibraryService.getResourceSortList($stateParams.restype).then(function (res) {
  542. console.log('排序条件列表', res)
  543. if (res.code == 3350) {
  544. $scope.sortList = res.data[0];
  545. checkedsort = $stateParams.checkedsort ? $stateParams.checkedsort : '';
  546. if ($stateParams.checkedsort) {
  547. $scope.sortList.items.forEach((res) => {
  548. if (res.labelKey == $stateParams.checkedsort) {
  549. res.selected = true
  550. }
  551. })
  552. } else {
  553. // $scope.sortList.items[0] ? ($scope.sortList.items[0].selected = true) : false;
  554. // checkedsort = $scope.sortList.items.length > 0 ? $scope.sortList.items[0].labelKey : 'timestamp,desc';
  555. checkedsort = "timestamp,desc";
  556. if ($scope.sortList.items.length){
  557. $scope.sortList.items.forEach((res) => {
  558. if (res.labelKey == checkedsort) {
  559. res.selected = true
  560. }
  561. })
  562. }
  563. }
  564. deferred.resolve('sucess');
  565. }
  566. })
  567. return deferred.promise;
  568. };
  569. // 获取资源库下行业分类列表
  570. var getCategoryList = function () {
  571. /*ResourceLibraryService.getCategoryList(1001, reclibid, modlibid).then(function (response) {
  572. // console.log(response);
  573. $scope.categorylist = [{
  574. appModuleName: "全部",
  575. by1: ""
  576. }];
  577. $scope.categorylist = $scope.categorylist.concat(response.channelList);
  578. angular.forEach($scope.categorylist, function (value, index) {
  579. $scope.contentlist.push({isload: false, currentPage: 1, reslist: []});
  580. });
  581. $timeout(function () {
  582. $ionicSlideBoxDelegate.slide(chooseIndex);
  583. $scope.getPrivateResourceList();
  584. }, 100);
  585. }, function () {
  586. UtilService.showMess("网络不给力,请重试");
  587. })*/
  588. // 获取资源列表-全部企业
  589. getResourceSortList().then(function (res) {
  590. $scope.getAllPrivateResourceList(0);
  591. // 获取资源列表-我的企业
  592. //TODO
  593. // userid = 859;
  594. $scope.getPrivateResourceList(userid);
  595. })
  596. };
  597. //导出所有企业基本信息
  598. $scope.onexportAllOrg = function () {
  599. $scope.showLoadingToastUtilEnd();
  600. ResourceLibraryService.getexportAllOrg().then(function (res) {
  601. $scope.hideLoadingToast();
  602. var aEle = document.createElement("a");// 创建a标签
  603. var blob = new Blob([res], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
  604. aEle.download = '企业库基本信息';// 设置下载文件的文件名
  605. aEle.href = URL.createObjectURL(blob);
  606. aEle.click();// 设置点击事件
  607. }).catch(function (res) {
  608. $scope.hideLoadingToast();
  609. $ionicPopup.alert({
  610. title: '提示',
  611. template: "服务器错误"
  612. });
  613. })
  614. }
  615. //获取资源列表-我的企业
  616. $scope.getPrivateResourceList = function (id) {
  617. $scope.isloadingPageFloor = true;
  618. // $scope.showLoadingToast();
  619. 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) {
  620. console.log('收藏', response);
  621. if ($stateParams.restype == 30) {
  622. angular.forEach(response.data, function (res) {
  623. if (!res.title) {
  624. dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
  625. if (resp.code == 3350 && resp.data.length > 0) {
  626. var temp = resp.data.filter(function (val) {
  627. return val.code == res.primTag;
  628. })
  629. if (temp.length > 0) {
  630. res.title = temp[0].name;
  631. }
  632. }
  633. }, function () {
  634. })
  635. }
  636. })
  637. }
  638. var tempreslib = angular.fromJson(response.data);
  639. $scope.mypages = angular.fromJson(response.page);
  640. // console.log(tempreslib);
  641. var temppage = angular.fromJson(response.page);
  642. var totalPage = Math.ceil((temppage == null ? 0 : temppage.totalCount == null ? 0 : temppage.totalCount) / 4);
  643. // console.log(totalPage);
  644. angular.forEach(tempreslib, function (val) {
  645. if (val.labelObj) {
  646. val.labelObj = val.labelObj.slice(0, 3);
  647. // angular.forEach(val.otherObj,function(vv){
  648. // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
  649. // })
  650. }
  651. })
  652. $scope.contentlist[chooseIndex].reslist = tempreslib;
  653. 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>";
  654. $timeout(function () {
  655. $(".resourcelistDiv.list").prepend(trHtml);
  656. $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
  657. }, 800);
  658. $timeout(function () {
  659. $(".refresh_tip_div").slideUp();
  660. }, 1200);
  661. //判断是否有下一页
  662. $timeout(function () {
  663. $timeout(function () {
  664. if ($scope.contentlist[chooseIndex].currentPage >= totalPage) {
  665. $scope.contentlist[chooseIndex].isload = false;
  666. } else {
  667. $scope.contentlist[chooseIndex].isload = true;
  668. }
  669. $scope.contentlist[chooseIndex].currentPage = 1;
  670. }, 1000);
  671. // $scope.hideLoadingToast();
  672. $ionicSlideBoxDelegate.update();
  673. $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
  674. }, 50);
  675. $scope.isloadingPageFloor = false;
  676. $scope.isloadingPageFail = false;
  677. $scope.isloadingPageFailAll = false;
  678. }, function () {
  679. // $scope.hideLoadingToast();
  680. $scope.isloadingPageFloor = false;
  681. $scope.isloadingPageFail = true;
  682. $scope.isloadingPageFailAll = false;
  683. }).finally(function () {
  684. $scope.$broadcast('scroll.refreshComplete');
  685. });
  686. };
  687. //加载更多资源列表-我的企业
  688. $scope.loadMore = function (id) {
  689. $scope.contentlist[chooseIndex].isload = false;
  690. $scope.loadmore = true;
  691. // $scope.showLoadingToast();
  692. // ResourceLibraryService.getSecondResourceList(1001, $scope.checked, checkedsort, $scope.categorylist[chooseIndex].by1, "", $scope.contentlist[chooseIndex].currentPage, reclibid).then(function (response) {
  693. ResourceLibraryService.getSecondResourceList(sessionStorage.restype, sessionStorage.groupid,
  694. $scope.contentlist[chooseIndex].currentPage, $scope.keyfilter.key, checkedsort, id, ConstantService.TRACE_TYPE_2619, category, $scope.labelKeys, JSON.stringify(Traverse()), $scope.capacityparams).then(function (response) {
  695. console.log('方法走了吗', response);
  696. // $scope.hideLoadingToast();
  697. if ($stateParams.moduleid == 30) {
  698. angular.forEach(response.data, function (res) {
  699. if (!res.title) {
  700. dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
  701. if (resp.code == 3350 && resp.data.length > 0) {
  702. var temp = resp.data.filter(function (val) {
  703. return val.code == res.primTag;
  704. })
  705. if (temp.length > 0) {
  706. res.title = temp[0].name;
  707. }
  708. }
  709. }, function () {
  710. })
  711. }
  712. })
  713. }
  714. var tempreslib = angular.fromJson(response.data);
  715. angular.forEach(tempreslib, function (val) {
  716. if (val.labelObj) {
  717. val.labelObj = val.labelObj.slice(0, 3);
  718. // angular.forEach(val.otherObj,function(vv){
  719. // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
  720. // })
  721. }
  722. })
  723. $scope.mypages = angular.fromJson(response.page);
  724. var temppage = angular.fromJson(response.page);
  725. var totalPage = Math.ceil(temppage.totalCount / 4);
  726. // console.log(totalPage);
  727. //加载数据,更新当前页数
  728. $timeout(function () {
  729. if (tempreslib.length > 0) {
  730. $scope.contentlist[chooseIndex].reslist = $scope.contentlist[chooseIndex].reslist.concat(tempreslib);
  731. }
  732. $scope.loadmore = false;
  733. }, 2000);
  734. // $scope.hideLoadingToast();
  735. //判断是否有下一页
  736. $timeout(function () {
  737. if ($scope.contentlist[chooseIndex].currentPage >= totalPage) {
  738. $scope.contentlist[chooseIndex].isload = false;
  739. } else {
  740. $scope.contentlist[chooseIndex].isload = true;
  741. }
  742. $scope.contentlist[chooseIndex].currentPage++;
  743. }, 2000);
  744. if (selectflg) {
  745. $timeout(function () {
  746. $(".item-options").addClass("invisible");
  747. $(".resource_wrap").css("left", "10%");
  748. $(".pay_list_c2").css("left", "4%");
  749. $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
  750. $("#collect-bottom").css("display", "block");
  751. }, 20);
  752. }
  753. }, function () {
  754. // $scope.hideLoadingToast();
  755. $scope.loadmore = false;
  756. }).finally(function () {
  757. $scope.$broadcast('scroll.infiniteScrollComplete');
  758. });
  759. };
  760. $scope.showManagmentSheet = function () {
  761. var buttonlist = [
  762. // {text: '导入'},
  763. {text: '导出'}
  764. ];
  765. $ionicActionSheet.show({
  766. buttons: buttonlist,
  767. cancelText: '取消',
  768. buttonClicked: function (index) {
  769. console.log(index)
  770. // if (index == 0) {
  771. // $scope.go("importOrgInfo", {restype: $scope.restype});
  772. // }
  773. if (index == 0) {
  774. $scope.showLoadingToast();
  775. $scope.showExportResourceClick();
  776. setTimeout(function () {
  777. $scope.showExportFlag = !$scope.showExportFlag;
  778. $scope.hideLoadingToast();
  779. }, 2000);
  780. return true;
  781. }
  782. }
  783. })
  784. }
  785. $scope.choiceExportField = function () {
  786. /*if (!$scope.flag && $scope.allcontentlist[0].reslist.length == 6) {
  787. $scope.showExportResourceClick();
  788. $timeout(function () {
  789. jumptoexportField($scope.allcontentlist[0].reslist);
  790. }, 1000);
  791. } else {
  792. jumptoexportField($scope.allcontentlist[0].reslist);
  793. }*/
  794. $scope.jumptoexportField($scope.allcontentlist[0].reslist);
  795. }
  796. $scope.jumptoexportField = function (reslist) {
  797. $scope.contenttemplist = [];
  798. $scope.uniquelist = [];
  799. angular.forEach(reslist, function (val) {
  800. if (val.isselected) {
  801. $scope.contenttemplist.push(val.resource);
  802. $scope.uniquelist.push(val.resource.unique);
  803. }
  804. })
  805. if ($scope.uniquelist.length == 0) {
  806. $ionicPopup.alert({
  807. title: '提示',
  808. template: "<p style='text-align: center;'>请先选择企业!</p>",
  809. buttons: [{text: "确定"}]
  810. });
  811. return;
  812. }
  813. $scope.go("exportField", {"reslist": $scope.contenttemplist, "uniquelist": $scope.uniquelist});
  814. }
  815. $scope.showExportFlag = true;
  816. $scope.showExportResourceClick = function () {
  817. var labelkey = "";
  818. angular.forEach($scope.filterList, function (filter) {
  819. if (filter.items[0].isselect) {
  820. } else {
  821. angular.forEach(filter.items, function (item) {
  822. if (item.isselect) {
  823. labelkey += (item.labelKey + ",");
  824. }
  825. })
  826. }
  827. }).getFirstResourceListForAll(sessionStorage.restype, sessionStorage.groupid, 0, "", "", 0, 0, "", labelkey).then(function (res) {
  828. console.log(res)
  829. if (res.code == 3350) {
  830. var resbackuplist = [];
  831. angular.forEach(res.data, function (res) {
  832. var temphtml = {
  833. resource: res,
  834. isselected: false
  835. };
  836. resbackuplist.push(temphtml);
  837. })
  838. $scope.allcontentlist[0].reslist = resbackuplist;
  839. $scope.allpages.totalCount = resbackuplist.length;
  840. }
  841. })
  842. }
  843. $scope.showFinishlick = function () {
  844. $scope.showExportFlag = true;
  845. $scope.allcontentlist[0].reslist = $scope.resbackuplist;
  846. }
  847. //全选
  848. $scope.flag = true;
  849. $scope.choiceAllResource = function () {
  850. if ($scope.flag) {
  851. angular.forEach($scope.allcontentlist[0].reslist, function (val) {
  852. val.isselected = true;
  853. })
  854. } else {
  855. angular.forEach($scope.allcontentlist[0].reslist, function (val) {
  856. val.isselected = false;
  857. })
  858. }
  859. $scope.flag = !$scope.flag;
  860. }
  861. //重新加载全部企业
  862. $scope.repeatLoadAll = function () {
  863. $scope.isloadingPageFailAll = false;
  864. $scope.getAllPrivateResourceList(0);
  865. };
  866. //重新加载我的企业
  867. $scope.repeatLoad = function () {
  868. $scope.isloadingPageFail = false;
  869. $scope.getPrivateResourceList(userid);
  870. };
  871. //获取资源列表-全部企业
  872. $scope.getAllPrivateResourceList = function (id) {
  873. $scope.isloadingPageFloor = true;
  874. // $scope.showLoadingToast();
  875. // console.log(id);
  876. 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) {
  877. $scope.hideLoadingToast();
  878. $scope.deleteSet = new Set();
  879. $scope.resourceLength = response.data == null ? 0 : response.data.length;
  880. $scope.page = response.page
  881. if ($stateParams.libtype == 30) {
  882. angular.forEach(response.data, function (res) {
  883. if (!res.title) {
  884. dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
  885. if (resp.code == 3350 && resp.data.length > 0) {
  886. var temp = resp.data.filter(function (val) {
  887. return val.code == res.primTag;
  888. })
  889. if (temp.length > 0) {
  890. res.title = temp[0].name;
  891. }
  892. }
  893. }, function () {
  894. })
  895. }
  896. })
  897. }
  898. var tempreslib = angular.fromJson(response.data);
  899. angular.forEach(tempreslib, function (val) {
  900. if (val.labelObj) {
  901. val.labelObj = val.labelObj.slice(0, 3);
  902. // angular.forEach(val.otherObj,function(vv){
  903. // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
  904. // })
  905. }
  906. })
  907. $scope.allpages = angular.fromJson(response.page);
  908. var temppage = angular.fromJson(response.page);
  909. var totalPage = Math.ceil(temppage == null ? 0 : temppage.totalCount / 4);
  910. // console.log(totalPage);
  911. $scope.allcontentlist[chooseIndex].reslist = tempreslib;
  912. $scope.resbackuplist = $scope.allcontentlist[chooseIndex].reslist;
  913. 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>";
  914. $timeout(function () {
  915. $(".resourcelistDiv .list").prepend(trHtml);
  916. $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
  917. }, 800);
  918. $timeout(function () {
  919. $(".refresh_tip_div").slideUp();
  920. }, 1200);
  921. //判断是否有下一页
  922. $timeout(function () {
  923. $timeout(function () {
  924. if ($scope.allcontentlist[chooseIndex].currentPage >= totalPage) {
  925. $scope.allcontentlist[chooseIndex].isload = false;
  926. } else {
  927. $scope.allcontentlist[chooseIndex].isload = true;
  928. }
  929. $scope.allcontentlist[chooseIndex].currentPage = 1;
  930. var allcontenttemplist = [];
  931. angular.forEach($scope.allcontentlist[chooseIndex].reslist, function (res) {
  932. var temphtml = {
  933. resource: res,
  934. isselected: false
  935. };
  936. allcontenttemplist.push(temphtml);
  937. })
  938. $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
  939. $scope.resbackuplist = $scope.allcontentlist[chooseIndex].reslist;
  940. }, 0);
  941. $scope.hideLoadingToast();
  942. $ionicSlideBoxDelegate.update();
  943. $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
  944. }, 50);
  945. $scope.clickResource = function (resource) {
  946. resource.isselected = !resource.isselected;
  947. if (resource.isselected === true) {
  948. $scope.deleteSet.add(resource.resource.unique);
  949. }else {
  950. $scope.deleteSet.delete(resource.resource.unique);
  951. }
  952. console.log($scope.deleteSet);
  953. }
  954. $scope.isloadingPageFloor = false;
  955. $scope.isloadingPageFail = false;
  956. $scope.isloadingPageFailAll = false;
  957. }, function () {
  958. $scope.hideLoadingToast();
  959. $scope.isloadingPageFloor = false;
  960. $scope.isloadingPageFail = false;
  961. $scope.isloadingPageFailAll = true;
  962. }).finally(function () {
  963. $scope.$broadcast('scroll.refreshComplete');
  964. });
  965. };
  966. //分页
  967. $scope.handlepagination = function (currentPage) {
  968. $scope.deleteSet.clear();
  969. $scope.allcontentlist[chooseIndex].currentPage = currentPage
  970. $scope.showLoadingToast();
  971. $scope.loadMoreForAll(0)
  972. }
  973. //加载更多资源列表-全部企业
  974. //
  975. $scope.loadMoreForAll = function (id) {
  976. // $scope.allcontentlist[chooseIndex].isload = false;
  977. $scope.allloadmore = true;
  978. // $scope.showLoadingToast();
  979. // ResourceLibraryService.getSecondResourceList(1001, $scope.checked, checkedsort, $scope.categorylist[chooseIndex].by1, "", $scope.contentlist[chooseIndex].currentPage, reclibid).then(function (response) {
  980. 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) {
  981. if ($stateParams.restype == 30) {
  982. angular.forEach(response.data, function (res) {
  983. if (!res.title) {
  984. dataToolsService.getWebCascade(res.type, 0).then(function (resp) {
  985. if (resp.code == 3350 && resp.data.length > 0) {
  986. var temp = resp.data.filter(function (val) {
  987. return val.code == res.primTag;
  988. })
  989. if (temp.length > 0) {
  990. res.title = temp[0].name;
  991. }
  992. }
  993. }, function () {
  994. })
  995. }
  996. })
  997. }
  998. var tempreslib = angular.fromJson(response.data);
  999. angular.forEach(tempreslib, function (val) {
  1000. if (val.labelObj) {
  1001. val.labelObj = val.labelObj.slice(0, 3);
  1002. // angular.forEach(val.otherObj,function(vv){
  1003. // vv.labelName=vv.labelKey=='企业规模'?vv.labelKey+vv.labelName:vv.labelName=='是'?vv.labelKey.slice(2):vv.labelName;
  1004. // })
  1005. }
  1006. })
  1007. $scope.allpages = angular.fromJson(response.page);
  1008. var temppage = angular.fromJson(response.page);
  1009. // var totalPage = Math.ceil(temppage.totalCount / 4);
  1010. var totalPage = response.page.totalPage;
  1011. console.log(totalPage);
  1012. if ($scope.isapp) {
  1013. console.log($scope.allcontentlist)
  1014. if (tempreslib.length > 0) {
  1015. $scope.allcontentlist[chooseIndex].reslist = $scope.allcontentlist[chooseIndex].reslist.concat(tempreslib);
  1016. var allcontenttemplist = [];
  1017. angular.forEach($scope.allcontentlist[chooseIndex].reslist, function (res) {
  1018. if (res.isselected == undefined) {
  1019. var temphtml = {
  1020. resource: res,
  1021. isselected: false
  1022. };
  1023. allcontenttemplist.push(temphtml);
  1024. } else {
  1025. allcontenttemplist.push(res);
  1026. }
  1027. })
  1028. $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
  1029. }
  1030. $scope.allloadmore = false;
  1031. // $scope.hideLoadingToast();
  1032. //判断是否有下一页
  1033. if ($scope.allcontentlist[chooseIndex].currentPage >= totalPage) {
  1034. console.log(963412)
  1035. $scope.allcontentlist[chooseIndex].isload = false;
  1036. } else {
  1037. $scope.allcontentlist[chooseIndex].isload = true;
  1038. }
  1039. $scope.$broadcast('scroll.infiniteScrollComplete');
  1040. $scope.allcontentlist[chooseIndex].currentPage++;
  1041. } else {
  1042. var allcontenttemplist = [];
  1043. angular.forEach(tempreslib, function (res) {
  1044. if (res.isselected == undefined) {
  1045. var temphtml = {
  1046. resource: res,
  1047. isselected: false
  1048. };
  1049. allcontenttemplist.push(temphtml);
  1050. } else {
  1051. allcontenttemplist.push(res);
  1052. }
  1053. })
  1054. $scope.allcontentlist[chooseIndex].reslist = allcontenttemplist;
  1055. $scope.hideLoadingToast()
  1056. console.log($scope.allcontentlist)
  1057. }
  1058. //加载数据,更新当前页数
  1059. if (selectflg) {
  1060. $timeout(function () {
  1061. $(".item-options").addClass("invisible");
  1062. $(".resource_wrap").css("left", "10%");
  1063. $(".pay_list_c2").css("left", "4%");
  1064. $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
  1065. $("#collect-bottom").css("display", "block");
  1066. }, 20);
  1067. }
  1068. }, function () {
  1069. // $scope.hideLoadingToast();
  1070. $scope.allloadmore = false;
  1071. }).finally(function () {
  1072. $scope.$broadcast('scroll.infiniteScrollComplete');
  1073. });
  1074. };
  1075. getCategoryList();
  1076. $scope.islogin = ConfigService.islogin;
  1077. // 进入资源详情
  1078. $scope.goResourceDetail = function (resource, ind) {
  1079. if (!$scope.islogin && ($stateParams.restype != 30 && $stateParams.restype != 31 && $stateParams.restype != 32 &&
  1080. $stateParams.restype != 33 && $stateParams.restype != 34)) {
  1081. if (localStorage.wxFlag == "true") {
  1082. if (localStorage.isUserFocusXW == 0) {
  1083. var title = localStorage.appidStr;
  1084. $ionicPopup.alert({
  1085. title: '提示',
  1086. template: '请先关注微信公众号"' + title + '"!'
  1087. });
  1088. return;
  1089. } else {
  1090. if (localStorage.isUserBindWx == 0) {
  1091. var wxFlag = JSON.parse(localStorage.params);
  1092. if (wxFlag.weChatModel) {
  1093. $scope.go('bindPhone', {
  1094. params: localStorage.params,
  1095. comfrom: 'maincontroller',
  1096. url: window.location.href.split('#/')[1]
  1097. });
  1098. } else {
  1099. $scope.go('login');
  1100. return;
  1101. }
  1102. } else {
  1103. $scope.go('login');
  1104. return;
  1105. }
  1106. }
  1107. } else {
  1108. $scope.go('login');
  1109. return;
  1110. }
  1111. } else {
  1112. if (selectflg) {
  1113. selectResource(resource, ind);
  1114. } else {
  1115. resourceLibraryTempData.setCategoryIndex(chooseIndex);
  1116. resourceLibraryTempData.setChecked($scope.checked);
  1117. if (!$scope.groupid) {
  1118. $scope.groupid = $stateParams.groupid;
  1119. }
  1120. if (!$scope.restype) {
  1121. $scope.restype = $stateParams.restype;
  1122. }
  1123. if (resource.groupid == "0") {
  1124. $scope.go('resourceDetails', {
  1125. recourceid: resource.unique,
  1126. recourcetype: resource.type,
  1127. recourcecomefrom: resource.source,
  1128. title: resource.title,
  1129. comfrom: 'privateResource',
  1130. filterList: $scope.filterList,
  1131. reclibid: $scope.groupid,
  1132. moduleid: $scope.restype
  1133. });
  1134. } else {
  1135. $scope.go('resourceCommonDetailsPage', {
  1136. res: angular.toJson($stateParams.res),
  1137. recourceid: resource.unique,
  1138. recourcetype: resource.type,
  1139. recourcecomefrom: resource.source,
  1140. creator: resource.clickthrough,
  1141. title: resource.title,
  1142. orgtype: 0,
  1143. comfrom: 'privateResource',
  1144. pagecode: 0,
  1145. label: JSON.stringify(resource.otherObj),
  1146. filterList: $scope.filterList,
  1147. groupid: $scope.groupid,
  1148. restype: $scope.restype,
  1149. privateName: $scope.privateName,
  1150. MoreData: $scope.MoreData,
  1151. capacityparams: $scope.capacityparams,
  1152. checkedsort: checkedsort,
  1153. row: JSON.stringify(resource)
  1154. });
  1155. }
  1156. }
  1157. }
  1158. };
  1159. var editSlide = function (index) {
  1160. var tablength = $scope.categorylist.length;//标题个数
  1161. var middlewidth = $(window).width() / 2;//获取当前手机屏幕宽度一般
  1162. var OffLeft = $(".Chanel_scroll_a").eq(index).offset().left;//获取当前点击标题距离父容器左边框的距离
  1163. var SelfWidth = $(".Chanel_scroll_a").eq(index).width();//获取当前点击标题宽度
  1164. var startTranform = $("#p_Chanel .scroll").offset().left;
  1165. var movewidth = OffLeft - middlewidth + SelfWidth / 2;
  1166. startTranform -= movewidth;
  1167. if (startTranform <= 0) {
  1168. if (index < tablength - 2) {
  1169. $('#p_Chanel .scroll').css({
  1170. 'transform': 'translate3d(' + startTranform + 'px,0,0)'
  1171. });
  1172. }
  1173. } else if (index < 4) {
  1174. $('#p_Chanel .scroll').css({
  1175. 'transform': 'translate3d(0,0,0)'
  1176. });
  1177. }
  1178. $(".Chanel_scroll_a").eq(index).addClass("scroll_a_on").siblings().removeClass("scroll_a_on");
  1179. };
  1180. $scope.selectCategory = function (index) {
  1181. editSlide(index);
  1182. $(".Chanel_scroll_a").eq(index).addClass("scroll_a_on").siblings().removeClass("scroll_a_on");
  1183. if (index == chooseIndex) {
  1184. return;
  1185. }
  1186. chooseIndex = index;
  1187. $scope.index = chooseIndex;
  1188. $scope.getPrivateResourceList(0);
  1189. };
  1190. //资源库搜索
  1191. $scope.goResourceSearch = function () {
  1192. resourceLibraryTempData.setCategoryIndex(chooseIndex);
  1193. resourceLibraryTempData.setChecked($scope.checked);
  1194. //1:需求,2:成果,6:企业,8:人才
  1195. var tabindex = 3;
  1196. if ($scope.restype == 1) {
  1197. tabindex = 4;
  1198. } else if ($scope.restype == 2) {
  1199. tabindex = 3;
  1200. } else if ($scope.restype == 6) {
  1201. tabindex = 5;
  1202. } else if ($scope.restype == 8) {
  1203. tabindex = 6;
  1204. }
  1205. $timeout(function () {
  1206. $scope.go('resourceSearch', {resourcetype: 1001, restype: $scope.restype, tabindex: tabindex});
  1207. }, 350);
  1208. };
  1209. $scope.shareflg = false;
  1210. $scope.openShare = function (tempobj, ind) {
  1211. $scope.go('chooseShareResource', {
  1212. chereslist: angular.toJson([tempobj.unique]),
  1213. folderid: $scope.reclibid,
  1214. isCloud: 1,
  1215. recourcetype: tempobj.type,
  1216. recourcecomefrom: tempobj.source
  1217. });
  1218. /*$scope.shareflg = true;
  1219. $(".resource_wrap").css("left", "0%");
  1220. $(".pay_list_c2").css("left", "-35px");
  1221. $("#collect-bottom").css("display", "none");
  1222. checkedresource = tempobj;
  1223. checkedindex = ind;*/
  1224. };
  1225. $scope.closeShare = function () {
  1226. $timeout(function () {
  1227. $ionicListDelegate.closeOptionButtons();
  1228. }, 10);
  1229. $scope.shareflg = false;
  1230. };
  1231. //选择排序
  1232. $scope.chooseSort = function (b) {
  1233. $scope.checked.SortType = b.type;
  1234. checkedsort = b.value;
  1235. };
  1236. //选择分类
  1237. /*$scope.chooseClassification = function (tempclass) {
  1238. $scope.checked.classificationType = tempclass.type;
  1239. };*/
  1240. //地区
  1241. /*$scope.chooseActionlocation = function (index) {
  1242. $(".locationclassfile ul li").eq(index).addClass("specialSpan").siblings().removeClass("specialSpan");
  1243. if (index != 0) {
  1244. $(".locationclassfile ul li:first-child").css({"color": "#000", "border": "none"});
  1245. } else {
  1246. $(".locationclassfile ul li:first-child").css({"color": "#3385ff", "border": "#3385ff .5px solid"});
  1247. $(".locationclassfile ul li").removeClass("specialSpan");
  1248. }
  1249. };*/
  1250. //选择成熟度
  1251. $scope.chooseActionMaturity = function (s) {
  1252. $scope.checked.MaturityType = s.type;
  1253. };
  1254. //选择知识产产权
  1255. $scope.chooseActionRight = function (r) {
  1256. $scope.checked.RightType = r.type;
  1257. };
  1258. //选择合作模式
  1259. $scope.chooseActionModel = function (m) {
  1260. $scope.checked.ModelType = m.type;
  1261. };
  1262. //选择投入预算
  1263. $scope.chooseInputBudget = function (budget) {
  1264. $scope.checked.BudgetType = budget.type;
  1265. };
  1266. //选择企业规模
  1267. $scope.chooseEenterpriseScale = function (scale) {
  1268. $scope.checked.ScaleType = scale.type;
  1269. };
  1270. //高企
  1271. $scope.chooseStarType = function (star) {
  1272. $scope.checked.starType = star.type;
  1273. };
  1274. //选择企业类型
  1275. $scope.chooseEnterpriseType = function (enterprise) {
  1276. $scope.checked.EnterpriseType = enterprise.type;
  1277. };
  1278. //选择学位
  1279. $scope.chooseAcademicDegree = function (degree) {
  1280. $scope.checked.DegreeType = degree.type;
  1281. };
  1282. //性别
  1283. $scope.chooseSexType = function (sex) {
  1284. $scope.checked.sexType = sex.type;
  1285. };
  1286. //选择职称
  1287. $scope.chooseOccupationalTitle = function (title) {
  1288. $scope.checked.TitleType = title.type;
  1289. };
  1290. //选择学校类别
  1291. $scope.chooseUniversityType = function (university) {
  1292. $scope.checked.UniversityType = university.type;
  1293. };
  1294. //展开/收起排序
  1295. $scope.toggleSort = function () {
  1296. $(".sort ul").toggle();
  1297. $(".sort h3 i").toggleClass("transformArrow");
  1298. };
  1299. //展开/收起分类
  1300. /*$scope.toggleClassification = function () {
  1301. $(".Classification ul").toggle();
  1302. $(".Classification h3 i").toggleClass("transformArrow");
  1303. };
  1304. //展开/收起地区
  1305. $scope.toggleClassfilelocation = function () {
  1306. $(".locationclassfile ul").toggle();
  1307. $(".locationclassfile h3 i").toggleClass("transformArrow");
  1308. };*/
  1309. //展开/收起成熟度
  1310. $scope.toggleClassfileMaturity = function () {
  1311. $(".Maturityclassfile ul").toggle();
  1312. $(".Maturityclassfile h3 i").toggleClass("transformArrow");
  1313. };
  1314. //展开/收起知识产权
  1315. $scope.toggleClassfileRight = function () {
  1316. $(".Rightclassfile ul").toggle();
  1317. $(".Rightclassfile h3 i").toggleClass("transformArrow");
  1318. };
  1319. //展开/收起合作模式
  1320. $scope.toggleClassfileModel = function () {
  1321. $(".Modelclassfile ul").toggle();
  1322. $(".Modelclassfile h3 i").toggleClass("transformArrow");
  1323. };
  1324. //展开/收起投入预算
  1325. $scope.toggleInputBudget = function () {
  1326. $(".InputBudget ul").toggle();
  1327. $(".InputBudget h3 i").toggleClass("transformArrow");
  1328. };
  1329. //展开/收起企业规模
  1330. $scope.toggleEenterpriseScale = function () {
  1331. $(".EenterpriseScale ul").toggle();
  1332. $(".EenterpriseScale h3 i").toggleClass("transformArrow");
  1333. };
  1334. //展开/收起高企
  1335. $scope.toggleStarType = function () {
  1336. $(".StarType ul").toggle();
  1337. $(".StarType h3 i").toggleClass("transformArrow");
  1338. };
  1339. //展开/收起企业类型
  1340. $scope.toggleEnterpriseType = function () {
  1341. $(".EnterpriseType ul").toggle();
  1342. $(".EnterpriseType h3 i").toggleClass("transformArrow");
  1343. };
  1344. //展开/收起学位
  1345. $scope.toggleAcademicDegree = function () {
  1346. $(".AcademicDegree ul").toggle();
  1347. $(".AcademicDegree h3 i").toggleClass("transformArrow");
  1348. };
  1349. //展开/收起性别
  1350. $scope.toggleSexType = function () {
  1351. $(".sexType ul").toggle();
  1352. $(".sexType h3 i").toggleClass("transformArrow");
  1353. };
  1354. //展开/收起职称
  1355. $scope.toggleOccupationalTitle = function () {
  1356. $(".OccupationalTitle ul").toggle();
  1357. $(".OccupationalTitle h3 i").toggleClass("transformArrow");
  1358. };
  1359. //展开/收起学校类别
  1360. $scope.toggleUniversityType = function () {
  1361. $(".UniversityType ul").toggle();
  1362. $(".UniversityType h3 i").toggleClass("transformArrow");
  1363. };
  1364. $scope.finishShow = false;
  1365. //展开筛选
  1366. $scope.menueFilter = function () {
  1367. $scope.finishShow = true;
  1368. };
  1369. //完成选择,刷新数据
  1370. $scope.finishDone = function () {
  1371. $scope.finishShow = false;
  1372. // 获取资源列表-全部企业
  1373. $scope.getAllPrivateResourceList(0);
  1374. // 获取资源列表-我的企业
  1375. //TODO
  1376. // userid = 859;
  1377. $scope.getPrivateResourceList(userid);
  1378. };
  1379. //重置选择数据
  1380. $scope.reseChecked = function () {
  1381. $scope.checked = {
  1382. SortType: 0,
  1383. classificationType: libtype,
  1384. starType: 0,
  1385. MaturityType: 0,
  1386. RightType: 0,
  1387. ModelType: 0,
  1388. BudgetType: 0,
  1389. ScaleType: 0,
  1390. EnterpriseType: 0,
  1391. DegreeType: 0,
  1392. sexType: 0,
  1393. TitleType: 0,
  1394. UniversityType: 0
  1395. };
  1396. checkedsort = $scope.sorts[0].value;
  1397. };
  1398. //点击空白灰色选择条件隐藏
  1399. $scope.hideSortDiv = function () {
  1400. $scope.finishShow = false;
  1401. // 获取资源列表-全部企业
  1402. $scope.getAllPrivateResourceList(0);
  1403. // 获取资源列表-我的企业
  1404. //TODO
  1405. // userid = 859;
  1406. $scope.getPrivateResourceList(userid);
  1407. };
  1408. //打开操作表
  1409. $scope.openActionSheet = function () {
  1410. $ionicActionSheet.show({
  1411. buttons: [
  1412. {text: '设置'}
  1413. ],
  1414. cancelText: '取消',
  1415. buttonClicked: function (index) {
  1416. if (index == 0) {
  1417. $scope.go("authoritySet", {
  1418. resid: res.id,
  1419. authorityid: res.authorityid,
  1420. authoritycomefrom: res.authoritycomefrom,
  1421. name: res.name,
  1422. content: res.content,
  1423. sort: res.sort,
  1424. goflg: 1,
  1425. type: 1,
  1426. groupid: res.parentid
  1427. });
  1428. }
  1429. return true;
  1430. }
  1431. });
  1432. };
  1433. //分享选择操作表
  1434. var selectflg = false;//列表选择打开标志
  1435. $scope.openCollectShare = function () {
  1436. selectflg = true;
  1437. $scope.contentlist[$scope.index].reslist[checkedindex].value = true;
  1438. var tempres = {
  1439. infoid: checkedresource.unique,
  1440. infocomefrom: checkedresource.source,
  1441. infoType: checkedresource.type
  1442. };
  1443. $scope.checkedresourcelist.push(tempres);
  1444. $(".item-options").addClass("invisible");
  1445. $(".resource_wrap").css("left", "10%");
  1446. $(".pay_list_c2").css("left", "4%");
  1447. $(".item-content").css("transform", "translate3d(0px, 0px, 0px)");
  1448. $("#collect-bottom").css("display", "block");
  1449. $scope.closeShare();
  1450. };
  1451. //取消分享
  1452. $scope.cancelShare = function () {
  1453. angular.forEach($scope.contentlist[$scope.index].reslist, function (value, ind) {
  1454. $scope.contentlist[$scope.index].reslist[ind].value = false;
  1455. });
  1456. $scope.checkedresourcelist = [];
  1457. $(".resource_wrap").css("left", "0%");
  1458. $(".pay_list_c2").css("left", "-35px");
  1459. $("#collect-bottom").css("display", "none");
  1460. selectflg = false;
  1461. };
  1462. var selectResource = function (resource, ind) {
  1463. var tempres = {
  1464. infoid: resource.unique,
  1465. infocomefrom: resource.source,
  1466. infoType: resource.type
  1467. };
  1468. var chind = -1;
  1469. angular.forEach($scope.checkedresourcelist, function (value, index) {
  1470. if (value.infoid == resource.unique) {
  1471. chind = index;
  1472. }
  1473. });
  1474. if (chind == -1) {
  1475. $scope.contentlist[$scope.index].reslist[ind].value = true;
  1476. $scope.checkedresourcelist.unshift(tempres);
  1477. } else {
  1478. $scope.contentlist[$scope.index].reslist[ind].value = false;
  1479. $scope.checkedresourcelist.splice(chind, 1);
  1480. }
  1481. // console.log($scope.checkedresourcelist);
  1482. };
  1483. $scope.shareResourceToPrilib = function () {
  1484. $scope.go('chooseShareResource', {
  1485. chereslist: angular.toJson($scope.checkedresourcelist),
  1486. reclibid: $scope.reclibid
  1487. });
  1488. };
  1489. // 搜索各种资源信息
  1490. $scope.searchResourceList = function () {
  1491. // $scope.showLoadingToast();
  1492. var activity = ['task', 'mytask'];
  1493. if ($scope.act == activity[1]) {
  1494. // 获取资源列表-全部企业
  1495. $scope.getAllPrivateResourceList(0);
  1496. } else if ($scope.act == activity[0]) {
  1497. // 获取资源列表-我的企业
  1498. $scope.getPrivateResourceList(userid);
  1499. }
  1500. }, function () {
  1501. // $scope.hideLoadingToast();
  1502. };
  1503. //新建走访
  1504. $scope.goEnterCompanyInfo = function (restype) {
  1505. console.log(restype);
  1506. if (restype == 3 || restype == 30 || restype == 31 || restype == 32 || restype == 33 || restype == 34) {
  1507. if (!$scope.islogin) {
  1508. if (localStorage.wxFlag == "true") {
  1509. if (localStorage.isUserFocusXW == 0) {
  1510. var title = localStorage.appidStr;
  1511. $ionicPopup.alert({
  1512. title: '提示',
  1513. template: '请先关注微信公众号"' + title + '"!'
  1514. });
  1515. return;
  1516. } else {
  1517. if (localStorage.isUserBindWx == 0) {
  1518. var wxFlag = JSON.parse(localStorage.params);
  1519. if (wxFlag.weChatModel) {
  1520. $scope.go('bindPhone', {
  1521. params: localStorage.params,
  1522. comfrom: 'maincontroller',
  1523. url: window.location.href.split('#/')[1]
  1524. });
  1525. } else {
  1526. $scope.go('login');
  1527. return;
  1528. }
  1529. } else {
  1530. $scope.go('login');
  1531. return;
  1532. }
  1533. }
  1534. } else {
  1535. $scope.go('login');
  1536. return;
  1537. }
  1538. } else {
  1539. if (restype == 3) {
  1540. $scope.restype = 34;
  1541. $stateParams.restype = 34;
  1542. }
  1543. if ($stateParams.restype == 30 || $stateParams.restype == 31 || $stateParams.restype == 32 ||
  1544. $stateParams.restype == 33 || $stateParams.restype == 34) {
  1545. $scope.go('visitModularForm', {
  1546. companyid: 0,
  1547. pageid: moduleid,
  1548. orgtype: moduleid == 6 ? ConstantService.UNITTYPE_10104 : moduleid == 7 ? ConstantService.UNITTYPE_10105 : 0,
  1549. isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建
  1550. connid: 0,
  1551. pagecode: 1000030,
  1552. pageTitle: '新建' + $scope.privateName.slice(0, $scope.privateName.length - 1),
  1553. node: UserService.node,
  1554. comfrom: 'resource'
  1555. });
  1556. } else {
  1557. ResourceLibraryService.getPageId(restype).then(function (res) {
  1558. if (res.code == 3350) {
  1559. $scope.go('visitModularForm', {
  1560. companyid: 0,
  1561. pageid: res.data,
  1562. orgtype: restype == 6 || restype == 43 ? ConstantService.UNITTYPE_10104 : restype == 7 ? ConstantService.UNITTYPE_10105 : 0,
  1563. isedit: 0,// isedit:对应的是0新增/1编辑/2复制并新建
  1564. connid: 0,
  1565. pagecode: 1000030,
  1566. pageTitle: '新建' + $scope.privateName.slice(0, $scope.privateName.length),
  1567. node: UserService.node,
  1568. resourcetype: moduleid,
  1569. comfrom: 'privateResource'
  1570. });
  1571. }
  1572. })
  1573. }
  1574. }
  1575. }
  1576. if (restype == 44) {
  1577. $scope.go('visitModularForm', {
  1578. companyid: 0,
  1579. pageid: 44,
  1580. orgtype: 10104,
  1581. pagecode: 1000027,
  1582. isedit: 0,
  1583. node: UserService.node,
  1584. pageTitle: '新建导师'
  1585. });
  1586. }
  1587. if (restype == 39) {
  1588. $scope.go('visitModularForm', {
  1589. companyid: 0,
  1590. pageid: 39,
  1591. orgtype: 10104,
  1592. pagecode: 1000036,
  1593. isedit: 0,
  1594. node: UserService.node,
  1595. pageTitle: '新建金融信息',
  1596. innertype: 39
  1597. });
  1598. }
  1599. };
  1600. //假数据、添加星级、评分与评价数
  1601. // *******不能删,加载列表需要用到********
  1602. // 我的企业
  1603. $scope.contentlist = [
  1604. {
  1605. title: '企业A',
  1606. ishigh: 1,
  1607. industry: '化工',
  1608. starNum: 5,
  1609. commentListNum: 222,
  1610. },
  1611. {
  1612. title: '企业A',
  1613. ishigh: 1,
  1614. industry: '化工',
  1615. starNum: 4.5,
  1616. commentListNum: 102
  1617. },
  1618. {
  1619. title: '企业A',
  1620. ishigh: 1,
  1621. industry: '化工',
  1622. starNum: 4,
  1623. commentListNum: 82
  1624. },
  1625. {
  1626. title: '企业B',
  1627. ishigh: 1,
  1628. industry: '化工',
  1629. starNum: 3.5,
  1630. commentListNum: 62
  1631. },
  1632. {
  1633. title: '企业C',
  1634. ishigh: 1,
  1635. industry: '化工',
  1636. starNum: 3,
  1637. commentListNum: 42
  1638. },
  1639. {
  1640. title: '企业D',
  1641. ishigh: 0,
  1642. industry: '化工',
  1643. starNum: 2,
  1644. commentListNum: 32
  1645. },
  1646. {
  1647. title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
  1648. ishigh: 0,
  1649. industry: '化工',
  1650. starNum: 1,
  1651. commentListNum: 22
  1652. },
  1653. {
  1654. title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
  1655. ishigh: 0,
  1656. industry: '化工',
  1657. starNum: 0,
  1658. commentListNum: 12
  1659. }
  1660. ];
  1661. // 全部企业
  1662. $scope.allcontentlist = [
  1663. {
  1664. title: '企业A',
  1665. ishigh: 1,
  1666. industry: '化工',
  1667. starNum: 5,
  1668. commentListNum: 222,
  1669. },
  1670. {
  1671. title: '企业A',
  1672. ishigh: 1,
  1673. industry: '化工',
  1674. starNum: 4.5,
  1675. commentListNum: 102
  1676. },
  1677. {
  1678. title: '企业A',
  1679. ishigh: 1,
  1680. industry: '化工',
  1681. starNum: 4,
  1682. commentListNum: 82
  1683. },
  1684. {
  1685. title: '企业B',
  1686. ishigh: 1,
  1687. industry: '化工',
  1688. starNum: 3.5,
  1689. commentListNum: 62
  1690. },
  1691. {
  1692. title: '企业C',
  1693. ishigh: 1,
  1694. industry: '化工',
  1695. starNum: 3,
  1696. commentListNum: 42
  1697. },
  1698. {
  1699. title: '企业D',
  1700. ishigh: 0,
  1701. industry: '化工',
  1702. starNum: 2,
  1703. commentListNum: 32
  1704. },
  1705. {
  1706. title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
  1707. ishigh: 0,
  1708. industry: '化工',
  1709. starNum: 1,
  1710. commentListNum: 22
  1711. },
  1712. {
  1713. title: '企业的名字好长好长好长好长好长好长好长好长好长好长好长好长好长好长好长',
  1714. ishigh: 0,
  1715. industry: '化工',
  1716. starNum: 0,
  1717. commentListNum: 12
  1718. }
  1719. ]
  1720. $scope.editItem = function () {
  1721. console.log(1);
  1722. }
  1723. $scope.deletItem = function (id, node, idx) {
  1724. let deleteList = [];
  1725. if (id){
  1726. deleteList.push(id);
  1727. }else {
  1728. deleteList = Array.from($scope.deleteSet);
  1729. }
  1730. console.log(deleteList);
  1731. $ionicPopup.confirm({
  1732. title: '删除确认',
  1733. template: '请确认是否要删除!',
  1734. cancelText: '取消',
  1735. okText: '确认',
  1736. }).then(function (res) {
  1737. if (res) {
  1738. dataToolsService.deleteresource(deleteList).then(function (res) {
  1739. console.log(res)
  1740. if (res.code == 3350) {
  1741. if ($scope.app) {
  1742. UtilService.showMess('删除成功');
  1743. } else {
  1744. CommonService.showMessage('删除成功', $scope);
  1745. }
  1746. if ($scope.act == activity[1]) {
  1747. // setTimeout(()=>{
  1748. // $scope.getAllPrivateResourceList(0);
  1749. // },1000)
  1750. // 获取资源列表-全部企业
  1751. $scope.getAllPrivateResourceList(0);
  1752. } else if ($scope.act == activity[0]) {
  1753. // 获取资源列表-我的企业
  1754. $scope.getPrivateResourceList(userid);
  1755. }
  1756. } else {
  1757. if ($scope.app) {
  1758. UtilService.showMess('删除失败');
  1759. } else {
  1760. CommonService.showMessage('删除失败', $scope);
  1761. }
  1762. }
  1763. })
  1764. } else {
  1765. // console.log('You are not sure');
  1766. }
  1767. });
  1768. }
  1769. // 筛选条件页面
  1770. $ionicModal.fromTemplateUrl('./modules/common/views/filterPage.html', {
  1771. scope: $scope,
  1772. animation: 'slide-in-left'
  1773. }).then(function (modal) {
  1774. $scope.filterPageModal = modal;
  1775. });
  1776. $ionicModal.fromTemplateUrl('./modules/common/views/filterPagetl.html', {
  1777. scope: $scope,
  1778. }).then(function (modal) {
  1779. $scope.filtertlPageModaltl = modal;
  1780. });
  1781. $scope.showSideBar = function () {
  1782. $scope.filterPageModal.show();
  1783. }
  1784. // $scope.taskTypeList =
  1785. // {
  1786. // title: '需求类型',
  1787. // items: [
  1788. // {labelName: '全部', labelKey: 0, selected: true},
  1789. // {labelName: '技术需求', labelKey: 5350, selected: false},
  1790. // {labelName: '人才需求', labelKey: 5351, selected: false},
  1791. // {labelName: '投融资需求', labelKey: 5353, selected: false},
  1792. // {labelName: '其他', labelKey: 5354, selected: false},
  1793. // ]
  1794. // }
  1795. if ($scope.filterList == null || $scope.filterList.length == 0) {
  1796. $scope.filterList = [];
  1797. }
  1798. $scope.showFilter = false;
  1799. if ($scope.filterList == null || $scope.filterList.length == 0) {
  1800. ResourceLibraryService.getFilterList(sessionStorage.restype).then(function (res) {
  1801. console.log(res);
  1802. if (res.code == 3350 && res.data.length > 0) {
  1803. $scope.showFilter = true;
  1804. $scope.filterList = res.data;
  1805. angular.forEach($scope.filterList, function (val) {
  1806. if (val.title != '国高' && val.title != '规上' && val.title != '潜力库') {
  1807. val.items.unshift({
  1808. labelName: '全部',
  1809. labelKey: 88888888,
  1810. 'isselect': true,
  1811. selected: true
  1812. });
  1813. }
  1814. })
  1815. }
  1816. })
  1817. }
  1818. $scope.changSelected = function (item, outerIndex, index) {
  1819. console.log(item, outerIndex, index, $scope.privateName, $scope.filterList)
  1820. // if($scope.privateName=='成果库'){
  1821. angular.forEach($scope.filterList, function (val1) {
  1822. angular.forEach(val1.items, function (val2) {
  1823. val2.selected = false;
  1824. val2.isselect = false;
  1825. })
  1826. })
  1827. item.selected = !item.selected;
  1828. item.isselect = !item.isselect;
  1829. // }
  1830. // else {
  1831. // item.selected = !item.selected;
  1832. // item.isselect = !item.isselect;
  1833. // angular.forEach($scope.filterList, function (val1) {
  1834. // angular.forEach(val1.items, function (val2) {
  1835. // if (val2.labelName == item.labelName && item.isselect && item.labelName != "全部") {
  1836. // val1.items[0].selected = false;
  1837. // val1.items[0].isselect = false;
  1838. // }
  1839. // if(item.labelName == "全部"&&val2.labelName!='全部'){
  1840. // val2.selected = false;
  1841. // val2.isselect = false;
  1842. // }
  1843. // })
  1844. // })
  1845. // }
  1846. }
  1847. $scope.removeResourceByItems = function (item) {
  1848. item.selected = !item.selected;
  1849. item.isselect = !item.isselect;
  1850. $scope.submitSelected();
  1851. }
  1852. $scope.resetSelected = function () {
  1853. angular.forEach($scope.filterList, function (val) {
  1854. angular.forEach(val.items, function (value, index) {
  1855. value.selected = index == 0;
  1856. })
  1857. })
  1858. angular.forEach($scope.sortList.items, function (value, index) {
  1859. value.selected = index == 0;
  1860. })
  1861. $scope.labelKeys = '';
  1862. //重新加载全部企业
  1863. /*$scope.showLoadingToast();
  1864. $scope.repeatLoadAll();
  1865. $scope.repeatLoad();*/
  1866. $scope.selectBySort(0);
  1867. // $scope.filterList.key='';
  1868. // $scope.currentnode=UserService.node;
  1869. // if ($scope.act == 'task') {
  1870. // if(!$scope.islogin){
  1871. // }else{
  1872. // //TODO
  1873. // getMyData(0).then(function(data){
  1874. // $scope.reportCompanyList=data;
  1875. // })
  1876. // }
  1877. // } else if ($scope.act == 'mytask') {
  1878. // getData(1).then(function(data){
  1879. // $scope.reportCompanyList=data;
  1880. // });
  1881. // }
  1882. }
  1883. $scope.submitSelected = function () {
  1884. if ($scope.selectif != 6 && $scope.node == '330122000' && $scope.privateName == '企业库') {
  1885. /* 页面筛选不展示,以下代码注释 */
  1886. // if ($scope.filterList.length && $scope.filterList[2].items.length > 0) {
  1887. // $scope.filterList[2].items.forEach((res) => {
  1888. // res.selected = false
  1889. // })
  1890. // $scope.capacityparams = '0'
  1891. // }
  1892. }
  1893. $scope.labelKeys = '';
  1894. angular.forEach($scope.filterList, function (val) {
  1895. angular.forEach(val.items, function (value) {
  1896. if (value.selected && value.labelName != '全部' && val.title != '潜力库') {
  1897. $scope.labelKeys += value.labelKey + ',';
  1898. }
  1899. })
  1900. });
  1901. //重新加载全部企业
  1902. $scope.showLoadingToast();
  1903. $scope.repeatLoadAll();
  1904. $scope.repeatLoad();
  1905. if ($scope.node == '330122000') {
  1906. $scope.filtertlPageModaltl.hide();
  1907. } else {
  1908. $scope.filterPageModal.hide();
  1909. }
  1910. }
  1911. //桐庐筛选重置
  1912. $scope.resetSelectedtl = function () {
  1913. if ($scope.selectif == 5 || $scope.selectif == 6) {
  1914. $scope.MoreData.forEach(function (res) {
  1915. res.ifshow = false
  1916. res.content1 = ""
  1917. res.content2 = ""
  1918. if (res.choicetype == "dropdown/number" || res.choicetype == "number1") {
  1919. res.content3 = "请选择"
  1920. } else {
  1921. res.content3 = ""
  1922. }
  1923. })
  1924. }
  1925. if ($scope.selectif < 5) {
  1926. $scope.selectindex.items.forEach((res, index) => {
  1927. if (res.labelName == '全部') {
  1928. res.selected = true
  1929. } else {
  1930. res.selected = false
  1931. }
  1932. })
  1933. }
  1934. if ($scope.selectif == 6) {
  1935. angular.forEach($scope.filterList, function (val) {
  1936. if (val.title != '潜力库') {
  1937. // val.items.forEach((res) => {
  1938. // if (res.labelName == '全部') {
  1939. // res.selected = true
  1940. // } else {
  1941. // res.selected = false
  1942. // }
  1943. // })
  1944. }
  1945. });
  1946. $scope.labelKeys = '0'
  1947. }
  1948. }
  1949. //选择框回调
  1950. $scope.handletypes = function (item, index) {
  1951. $scope.MoreData[index].content3 = item
  1952. }
  1953. $scope.optclcick = function (item) {
  1954. }
  1955. //处理数据
  1956. function Traverse() {
  1957. let data = {}
  1958. if (!$scope.MoreData) {
  1959. return 0
  1960. }
  1961. $scope.MoreData.forEach((res) => {
  1962. if ((res.content3 != '请选择' && res.content1 && res.content2 && res.content3) || (res.propertytoes == "highidentificationdate" && res.content3 != '请选择' && res.content3)) {
  1963. data[res.propertytoes] = res.content3 + ""
  1964. }
  1965. if (res.content1 && res.content2) {
  1966. if (!res.content3) {
  1967. data[res.propertytoes] = res.content1
  1968. } else {
  1969. data[res.propertytoes] += "," + res.content1
  1970. }
  1971. data[res.propertytoes] += "," + res.content2
  1972. }
  1973. if (res.choicetype == 'text') {
  1974. data[res.propertytoes] = res.content1
  1975. }
  1976. if (res.ifshow) {
  1977. data[res.propertytoes] = res.value
  1978. }
  1979. if (res.choicetype == 'dropdown') {
  1980. res.items.forEach((optres) => {
  1981. if (optres.content1) {
  1982. if (data[res.propertytoes]) {
  1983. data[res.propertytoes] += "," + optres.value
  1984. } else {
  1985. data[res.propertytoes] = optres.value
  1986. }
  1987. }
  1988. })
  1989. }
  1990. })
  1991. if (Object.keys(data).length == 0) {
  1992. return 0
  1993. } else {
  1994. return data
  1995. }
  1996. }
  1997. if ($stateParams.MoreData) {
  1998. console.log($stateParams.MoreData)
  1999. $scope.MoreData = $stateParams.MoreData
  2000. } else {
  2001. ResourceLibraryService.getMorefilters($stateParams.restype).then(function (res) {
  2002. console.log(res)
  2003. if (res.code == 3350) {
  2004. $scope.MoreData = res.data
  2005. $scope.MoreData.forEach(function (res) {
  2006. res.ifshow = false
  2007. if (res.choicetype == "dropdown/number" || res.choicetype == "number1") {
  2008. res.content3 = "请选择"
  2009. }
  2010. })
  2011. }
  2012. })
  2013. }
  2014. //筛选
  2015. $scope.selectclick = function (item, index) {
  2016. console.log(index)
  2017. $scope.selectindex = item
  2018. $scope.filtertlPageModaltl.show();
  2019. $scope.selectif = index
  2020. }
  2021. var myDate = new Date();
  2022. var startYear = 2018;//起始年份
  2023. var endYear = myDate.getFullYear();//结束年份
  2024. $scope.Datedata = ["请选择"]
  2025. for (var i = startYear; i < endYear; i++) {
  2026. $scope.Datedata.push(i)
  2027. }
  2028. $scope.selectByLabeltl = function (item, outerIndex, index) {
  2029. $scope.selectindex.items.forEach((res) => {
  2030. if (item.labelName == '全部') {
  2031. res.selected = false
  2032. } else {
  2033. if (res.labelName == '全部') {
  2034. res.selected = false
  2035. }
  2036. }
  2037. })
  2038. item.selected = !item.selected
  2039. }
  2040. $scope.selectByLabel = function (item, outerIndex, index) {
  2041. $scope.flag = true;
  2042. $scope.contentlist[chooseIndex].reslist = [];
  2043. $scope.allcontentlist[chooseIndex].reslist = [];
  2044. $scope.changSelected(item, outerIndex, index);
  2045. if (!$scope.showExportFlag) {
  2046. $scope.showExportResourceClick();
  2047. } else {
  2048. $scope.submitSelected();
  2049. }
  2050. }
  2051. $scope.changSelectedSort = function (index) {
  2052. angular.forEach($scope.sortList.items, function (val) {
  2053. val.selected = false;
  2054. })
  2055. $scope.sortList.items[index].selected = true;
  2056. }
  2057. // $scope.changSelectedList = function (index) {
  2058. // angular.forEach($scope.typeList, function (val) {
  2059. // val.selected = false;
  2060. // })
  2061. // $scope.typeList[index].selected = true;
  2062. // }
  2063. // $scope.changSelectedTaskType = function (index) {
  2064. // angular.forEach($scope.taskTypeList.items, function (val) {
  2065. // val.selected = false;
  2066. // })
  2067. // $scope.taskTypeList.items[index].selected = true;
  2068. //
  2069. // }
  2070. $scope.selectdive = function (item, index, type) {
  2071. console.log(item)
  2072. $scope.filterList.forEach((res1, index1) => {
  2073. if (type) {
  2074. if (index != index1) {
  2075. res1.items.forEach((res2, index2) => {
  2076. res2.selected = false
  2077. })
  2078. }
  2079. } else {
  2080. res1.items.forEach((res2, index2) => {
  2081. if (index != index2 || res1.title != '潜力库') {
  2082. res2.selected = false
  2083. }
  2084. })
  2085. }
  2086. })
  2087. item.selected = !item.selected
  2088. if (item.selected) {
  2089. $scope.capacityparams = item.labelKey
  2090. } else {
  2091. $scope.capacityparams = '0'
  2092. }
  2093. $scope.selectif = 6
  2094. $scope.resetSelectedtl()
  2095. $scope.submitSelected()
  2096. }
  2097. $scope.selectBySort = function (index) {
  2098. $scope.contentlist[chooseIndex].reslist = [];
  2099. $scope.allcontentlist[chooseIndex].reslist = [];
  2100. checkedsort = $scope.sortList.items[index].labelKey;
  2101. $scope.changSelectedSort(index);
  2102. $scope.submitSelected();
  2103. }
  2104. // $scope.selectByList = function (index) {
  2105. // $scope.contentlist[chooseIndex].reslist = [];
  2106. // $scope.allcontentlist[chooseIndex].reslist = [];
  2107. // $scope.changSelectedList(index);
  2108. // $scope.submitSelected();
  2109. // }
  2110. // $scope.selectByTaskType = function (index) {
  2111. // $scope.contentlist[chooseIndex].reslist = [];
  2112. // $scope.allcontentlist[chooseIndex].reslist = [];
  2113. // checkedsort = $scope.taskTypeList.items[index].labelKey;
  2114. // $scope.changSelectedTaskType(index);
  2115. // $scope.submitSelected();
  2116. // }
  2117. // 设置置顶
  2118. $scope.changeStickTop = function (type, resid) {
  2119. console.log(resid);
  2120. if (type) {
  2121. ResourceLibraryService.cancelStickTop(resid).then(function (res) {
  2122. console.log(res);
  2123. if (res.code == 3350) {
  2124. $scope.contentlist[chooseIndex].reslist = [];
  2125. $scope.allcontentlist[chooseIndex].reslist = [];
  2126. $scope.submitSelected();
  2127. }
  2128. })
  2129. } else {
  2130. ResourceLibraryService.stickTop(resid).then(function (res) {
  2131. console.log(res);
  2132. if (res.code == 3350) {
  2133. $scope.contentlist[chooseIndex].reslist = [];
  2134. $scope.allcontentlist[chooseIndex].reslist = [];
  2135. $scope.submitSelected();
  2136. }
  2137. })
  2138. }
  2139. }
  2140. $scope.goNewNotification = function () {
  2141. $scope.go("notification");
  2142. }
  2143. })
  2144. ;