privateResourceCtrl.js 75 KB

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